Improve the documentation of dataverse (#116)
This commit is contained in:
parent
978de3b735
commit
949fe935cb
4 changed files with 698 additions and 6 deletions
|
@ -198,6 +198,14 @@ function ref<T>(key: string, initialValue: T): IRef<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An effect hook, similar to react's `useEffect()`.
|
||||
*
|
||||
* @param key: the key for the effect. Should be uniqe inside of the prism.
|
||||
* @param cb: the callback function. Optionally returns a cleanup function.
|
||||
* @param deps?: the dependency array
|
||||
*
|
||||
*/
|
||||
function effect(key: string, cb: () => () => void, deps?: unknown[]): void {
|
||||
const scope = hookScopeStack.peek()
|
||||
if (!scope) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue