Comparing version 3.1.4-29827da.0 to 3.1.4-5148a4c.0
@@ -44,2 +44,13 @@ import * as Logger from "bunyan"; | ||
/** | ||
* This method is used when matching the types of incoming actions against the types the `Updater`s and `Effect`s are | ||
* subscribed to. When this returns true, their corresponding functions will run. | ||
* | ||
* By default, this method tests for direct equivalence between the incoming candidate type and the type that is | ||
* subscribed. Override this method to extend this functionality (e.g. wildcards). | ||
* | ||
* @param candidateType The incoming action's type | ||
* @param subscribedType The type the Updater of Effect is subscribed to | ||
*/ | ||
protected matchActionType(candidateType: string, subscribedType: string): boolean; | ||
/** | ||
* Process actions against deterministically accumulating `Updater` functions. Returns a promise of versioned actions | ||
@@ -46,0 +57,0 @@ * for consumption by `runEffects`, to make sure the correct effects are run on blocks that include a `HandlerVersion` |
@@ -83,2 +83,15 @@ "use strict"; | ||
/** | ||
* This method is used when matching the types of incoming actions against the types the `Updater`s and `Effect`s are | ||
* subscribed to. When this returns true, their corresponding functions will run. | ||
* | ||
* By default, this method tests for direct equivalence between the incoming candidate type and the type that is | ||
* subscribed. Override this method to extend this functionality (e.g. wildcards). | ||
* | ||
* @param candidateType The incoming action's type | ||
* @param subscribedType The type the Updater of Effect is subscribed to | ||
*/ | ||
matchActionType(candidateType, subscribedType) { | ||
return candidateType === subscribedType; | ||
} | ||
/** | ||
* Process actions against deterministically accumulating `Updater` functions. Returns a promise of versioned actions | ||
@@ -97,3 +110,3 @@ * for consumption by `runEffects`, to make sure the correct effects are run on blocks that include a `HandlerVersion` | ||
updaterIndex += 1; | ||
if (action.type === updater.actionType) { | ||
if (this.matchActionType(action.type, updater.actionType)) { | ||
const { payload } = action; | ||
@@ -124,3 +137,3 @@ const newVersion = yield updater.apply(state, payload, blockInfo, context); | ||
for (const effect of this.handlerVersionMap[handlerVersionName].effects) { | ||
if (action.type === effect.actionType) { | ||
if (this.matchActionType(action.type, effect.actionType)) { | ||
const { payload } = action; | ||
@@ -127,0 +140,0 @@ effect.run(payload, block, context); |
{ | ||
"name": "demux", | ||
"version": "3.1.4-29827da.0", | ||
"version": "3.1.4-5148a4c.0", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Julien Heller", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
299795
748
0