@azothjs/channels
Advanced tools
Comparing version 0.3.6 to 0.3.7
{ | ||
"name": "@azothjs/channels", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "Asynchronous layout channels", | ||
@@ -5,0 +5,0 @@ "author": "Marty Nelson", |
@@ -5,9 +5,10 @@ import { Sync } from '../maya/compose/compose.js'; | ||
export function reduce(reducer, init) { | ||
export function reduce(reducer, init, initialAction = null) { | ||
if(reducer && typeof reducer !== 'function') { | ||
throw new TransformNotFunctionArgumentError(reducer, { method: 'reduce', param: 'reducer' }); | ||
} | ||
let state = reducer(init); | ||
let state = reducer(init, initialAction); | ||
const [iter, dispatch] = generator(action => state = reducer(state, action)); | ||
return [Sync.wrap(state, iter), dispatch]; | ||
} |
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
15048