conclure-quarx
Advanced tools
Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "conclure-quarx", | ||
"version": "0.4.2", | ||
"description": "Reactive flows", | ||
"type": "module", | ||
@@ -18,5 +21,2 @@ "dependencies": { | ||
}, | ||
"name": "conclure-quarx", | ||
"version": "0.4.1", | ||
"description": "Reactive flows", | ||
"main": "src/index.js", | ||
@@ -23,0 +23,0 @@ "module": "src/index.js", |
import { createAtom, autorun, Quarx } from 'quarx'; | ||
import { conclude, inProgress, isFlow, isIterator } from 'conclure'; | ||
import { conclude, inProgress, isFlow, isIterator, isEffect } from 'conclure'; | ||
import * as Combinators from 'conclure/combinators'; | ||
@@ -8,6 +9,18 @@ if (!Quarx.reactiveFlows) { | ||
const supportedEffects = new Set(Object.values(Combinators)); | ||
export const reactiveFlow = it => { | ||
if (isIterator(it)) { | ||
const flowType = isFlow(it); | ||
if (flowType === isIterator) { | ||
makeReactive(it).reportObserved(); | ||
} | ||
else if (flowType === isEffect && supportedEffects.has(it.fn)) { | ||
const flows = it.args[0]; | ||
for (let flow of (Array.isArray(flows) ? flows : Object.values(flows))) { | ||
reactiveFlow(flow); | ||
} | ||
} | ||
return it; | ||
@@ -14,0 +27,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8199
231