cycle-gear
Advanced tools
Comparing version 7.1.1 to 7.1.2
@@ -46,3 +46,3 @@ import { adapt } from '@cycle/run/lib/adapt'; | ||
} | ||
function spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, defaultConnector = {}, connectors = new Map()) { | ||
function spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, toothCombineGear = false, defaultConnector = {}, connectors = new Map()) { | ||
const modelCache = new WeakMap(); | ||
@@ -67,2 +67,5 @@ return gear => { | ||
} | ||
if (toothCombineGear) { | ||
view = view.map(v => [v, gear]); | ||
} | ||
return Object.assign(accum, { | ||
@@ -106,3 +109,3 @@ [tooth]: view | ||
else { | ||
const spinnning = spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, defaultConnector, connectors); | ||
const spinnning = spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, true, defaultConnector, connectors); | ||
spinCache.set(gear, spinnning); | ||
@@ -109,0 +112,0 @@ spins.push(spinnning); |
@@ -96,3 +96,4 @@ "use strict"; | ||
} | ||
function spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, defaultConnector, connectors) { | ||
function spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, toothCombineGear, defaultConnector, connectors) { | ||
if (toothCombineGear === void 0) { toothCombineGear = false; } | ||
if (defaultConnector === void 0) { defaultConnector = {}; } | ||
@@ -119,2 +120,5 @@ if (connectors === void 0) { connectors = new Map(); } | ||
} | ||
if (toothCombineGear) { | ||
view = view.map(function (v) { return [v, gear]; }); | ||
} | ||
return Object.assign(accum, (_a = {}, | ||
@@ -170,3 +174,3 @@ _a[tooth] = view, | ||
else { | ||
var spinnning = spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, defaultConnector, connectors); | ||
var spinnning = spinGear(sources, defaultIntent, defaultModel, defaultCatch, sourcesWrapper, teeth, toothFilter, toothView, true, defaultConnector, connectors); | ||
spinCache.set(gear, spinnning); | ||
@@ -173,0 +177,0 @@ spins.push(spinnning); |
@@ -103,2 +103,3 @@ import { adapt } from '@cycle/run/lib/adapt' | ||
toothView: (name: string, tooth: GearTooth<any> | GearView<any>) => GearView<any>, | ||
toothCombineGear = false, | ||
defaultConnector: ToothConnector<any, any, any, any> = {}, | ||
@@ -120,7 +121,10 @@ connectors: Map<string, ToothConnector<any, any, any, any>> = new Map()): (t: Gear<any, any>) => {} { | ||
const isolator = connectors.has(tooth) | ||
? connectors.get(tooth)!.isolate || defaultConnector.isolate | ||
: defaultConnector.isolate | ||
? connectors.get(tooth)!.isolate || defaultConnector.isolate | ||
: defaultConnector.isolate | ||
if (isolator) { | ||
view = xs.fromObservable(isolator(sources, view, gear)) | ||
} | ||
if (toothCombineGear) { | ||
view = view.map(v => [v, gear]) | ||
} | ||
return Object.assign(accum, { | ||
@@ -201,2 +205,3 @@ [tooth]: view | ||
toothView, | ||
true, | ||
defaultConnector, | ||
@@ -203,0 +208,0 @@ connectors) |
{ | ||
"name": "cycle-gear", | ||
"version": "7.1.1", | ||
"version": "7.1.2", | ||
"description": "Main function factory for CycleJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
69044
747