Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const completeInitPhase = () => {
if (fxCount === 0) {
fxID += 1
tryCompleteInitPhase && tryCompleteInitPhase()
}
}
const effects = []
const finalizers = []
for (let i = 0; i < clones.length; i++) {
const node = clones[i]
if (node.meta.unit !== 'effect') continue
effects.push(node)
finalizers.push(node.scope.runner.scope.anyway)
}
const onStart = createNode({
node: [
step.compute({
fn() {
fxCount += 1
fxID += 1
},
}),
],
parent: effects,
})
const onEnd = createNode({
node: [
step.run({
fn() {
fxCount -= 1
completeInitPhase()
const clones = list.map(({seq, next, meta, scope, family}) => {
const result = createNode({
node: seq.map(step => ({
id: step.id,
type: step.type,
data: Object.assign({}, step.data),
hasRef: step.hasRef,
})),
child: [...next],
meta: Object.assign({}, meta),
scope: Object.assign({}, scope),
})
result.family = {
type: family.type,
links: [...family.links],
owners: [...family.owners],
}
return result
if (node.meta.unit !== 'effect') continue
effects.push(node)
finalizers.push(node.scope.runner.scope.anyway)
}
const onStart = createNode({
node: [
step.compute({
fn() {
fxCount += 1
fxID += 1
},
}),
],
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