File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
20
20
} from "../../definitions/project" ;
21
21
import { IInjector } from "../definitions/yok" ;
22
22
import { injector } from "../yok" ;
23
- import { cache } from "../decorators" ;
23
+ import { memoize } from "../decorators" ;
24
24
25
25
class Hook implements IHook {
26
26
constructor ( public name : string , public fullPath : string ) { }
@@ -51,7 +51,14 @@ export class HooksService implements IHooksService {
51
51
return "hookArgs" ;
52
52
}
53
53
54
- @cache ( )
54
+ @memoize ( {
55
+ shouldCache ( ) {
56
+ // only cache if we have hooks directories, the only case to
57
+ // not have hooks directories is when the project dir is
58
+ // not set yet, ie. when creating a project.
59
+ return ! ! this . hooksDirectories . length ;
60
+ } ,
61
+ } )
55
62
private initialize ( projectDir : string ) : void {
56
63
this . cachedHooks = { } ;
57
64
You can’t perform that action at this time.
0 commit comments