Skip to content

Commit

Permalink
chore: special handling of arrays (#110)
Browse files Browse the repository at this point in the history
* fix: special handling of arrays

* chore: lint

* chore: rename
  • Loading branch information
alvinhui authored May 6, 2020
1 parent abf623e commit 4fafc3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/todos/src/models/todos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ const model = {
remove(state: TodosState, index: number) {
state.splice(index, 1);
},
set(state: TodosState, nextState: TodosState) {
return nextState;
},
},
effects: () => ({
async refresh() {
await delay(2000); // wait for data to load

// pass the result to a local reducer
this.setState([
this.set([
{
text: 'react',
},
Expand Down

0 comments on commit 4fafc3e

Please sign in to comment.