Skip to content

Commit

Permalink
docs: update react-native doc
Browse files Browse the repository at this point in the history
  • Loading branch information
leafOfTree committed Jun 11, 2019
1 parent bdbd9c8 commit 9457f42
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions docs/usage_with_react_native.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ class App extends React.Component {
});
};

increaseTwoAsync = () => {
this.props.dispatch({
type: "app/increaseTwoAsync"
});
};

render() {
return (
<View style={styles.container}>
Expand All @@ -63,7 +57,7 @@ class App extends React.Component {
<Text>
{this.props.loading ? 'Loading...' : <Text>&nbsp;</Text>}
</Text>
<View style={styles.buttons}>
<View>
<View style={styles.button}>
<Button
onPress={this.increase}
Expand All @@ -72,18 +66,10 @@ class App extends React.Component {
</View>
<View style={styles.button}>
<Button
style={styles.button}
onPress={this.increaseAsync}
title="Increase Asyn"
/>
</View>
<View style={styles.button}>
<Button
style={styles.button}
onPress={this.increaseTwoAsync}
title="Increase Two Asyn"
/>
</View>
</View>
</View>
);
Expand Down Expand Up @@ -153,30 +139,9 @@ export default [
const count = yield select(state => state.app.count);
yield put({
type: "update",
payload: {
count: count + 1
}
payload: { count: count + 1 }
});
},
*increaseTwoAsync(action) {
yield put({
type: "app/update",
payload: { loading: true }
});
yield call(delay, 500);
yield put({
type: "app/update",
payload: { loading: false }
});

const count = yield select(state => state.app.count);
yield put({
type: "app/update",
payload: {
count: count + 2
}
});
}
}
}
];
Expand Down

0 comments on commit 9457f42

Please sign in to comment.