doc: new hook
This commit is contained in:
parent
d935f85930
commit
bc60b11847
|
@ -74,6 +74,20 @@ export const hooks = {
|
||||||
// Do something with Class...
|
// Do something with Class...
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoked when a hook is HMR'd. Throw to abort hot reload and restart application.
|
||||||
|
* Must be synchronous.
|
||||||
|
*
|
||||||
|
* @param {string} hook The hook that was updated.
|
||||||
|
* @param {string} path The path of the fleck implementing the updated hook.
|
||||||
|
* @invokeSequential
|
||||||
|
*/
|
||||||
|
'@flecks/core.hmr.hook': (hook, path) => {
|
||||||
|
if ('@my/fleck.some.hook' === hook) {
|
||||||
|
throw new Error('hook too volatile, restart!');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when flecks is building a fleck dependency graph.
|
* Invoked when flecks is building a fleck dependency graph.
|
||||||
* @param {Digraph} graph The dependency graph.
|
* @param {Digraph} graph The dependency graph.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user