Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
],
parent: effects,
})
const onEnd = createNode({
node: [
step.run({
fn() {
fxCount -= 1
completeInitPhase()
},
}),
],
parent: finalizers,
})
if (start) {
launch(find(start), ctx)
}
isSyncComplete = true
completeInitPhase()
return defer.req
}
function flatGraph(unit) {
function universalLaunch(unit, payload) {
if (stack.length > 0) {
invoke(unit, payload)
} else {
launch(unit, payload)
}
}
export function fork(domain, {values = {}} = {}) {
export function invoke(unit, payload) {
if (stack.length === 0) {
throw Error('invoke cannot be called outside of forked .watch')
}
launch(stack[stack.length - 1](unit), payload)
}
? params => {
const req = new Defer()
launch(unit, {params, req})
return req.req
}
: payload => {
return payload => {
launch(result, payload)
}
}
: payload => {
launch(unit, payload)
return payload
}
return React.useCallback(result, [scope, event])