Skip to content

Commit

Permalink
add latest statem support (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
aksonov authored Jun 28, 2016
1 parent 76a5a26 commit f6796be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-router-flux",
"version": "3.30.2",
"version": "3.30.3",
"description": "React Native Router using Flux architecture",
"repository": {
"type": "git",
Expand Down
4 changes: 1 addition & 3 deletions src/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ export default function Switch(props) {
if (!selector && !statem) console.error('Selector should be defined.');
let index = -1;
if (!selector) {
assert(statem.isIn, 'Wrong statem passed');
// support Statem - Harel statecharts machine!
navState.children.forEach((el, i) => {
assert(el.default || el.state,
`Either default or state should be defined for element=${el.key}`);
if (el.default) {
index = i;
} else {
assert(el.state.id, 'State doesn\'t have id');
if (statem.isIn(el.state.id)) {
if (el.state.active) {
index = i;
}
}
Expand Down

0 comments on commit f6796be

Please sign in to comment.