Skip to content

Commit

Permalink
fix(batch-updates): pass undefined in case the namespace does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Dec 19, 2019
1 parent 364c98b commit 11c947d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export const converter = <T extends GenericObject>(
) => {
set(
(state: InnerNamespace<T>) =>
void fn(...ns.map(thisNs => state[thisNs].values)),
void fn(...ns.map(thisNs => (state[thisNs] || {}).values)),
HistoryEventType.PUSH
)
},
Expand All @@ -328,7 +328,7 @@ export const converter = <T extends GenericObject>(
) => {
set(
(state: InnerNamespace<T>) =>
void fn(...ns.map(thisNs => state[thisNs].values)),
void fn(...ns.map(thisNs => (state[thisNs] || {}).values)),
HistoryEventType.REPLACE
)
},
Expand Down

0 comments on commit 11c947d

Please sign in to comment.