-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
when returning fx and state from the reducer the state should be in the newState field
- Loading branch information
Matthieu Beteille
committed
Oct 20, 2017
1 parent
427f51a
commit 949086b
Showing
3 changed files
with
10 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export interface StateWithFx { | ||
[key: string]: any | ||
state: any | ||
newState: any | ||
_fx: { [key: string]: any } | ||
} | ||
|
||
export function hasFX(s: any): s is StateWithFx { | ||
return s && typeof s._fx === 'object' && '_fx' in s && 'state' in s | ||
return s && typeof s._fx === 'object' && '_fx' in s && 'newState' in s | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters