Update effects sections to latest API (#187)

They have to call done!
This commit is contained in:
Todd Kennedy
2016-07-21 10:16:46 -07:00
committed by GitHub
parent a913065262
commit 147dabfcd7
2 changed files with 12 additions and 3 deletions
+8 -2
View File
@@ -40,8 +40,14 @@ function createModel () {
} }
}, },
effects: { effects: {
close: () => stream.close(), close: (data, state, send, done) => {
error: (data, state) => console.error(`error: ${data.payload}`) stream.close()
done()
},
error: (data, state, send, done) => {
console.error(`error: ${data.payload}`
done()
}
} }
} }
} }
+4 -1
View File
@@ -11,7 +11,10 @@ app.model({
update: (data, state) => ({ title: data.payload }) update: (data, state) => ({ title: data.payload })
}, },
effects: { effects: {
update: (data, state, send) => (document.title = data.payload) update: (data, state, send, done) => {
document.title = data.payload
done()
}
} }
}) })