examples/http: update for ns

This commit is contained in:
Yoshua Wuyts
2016-05-23 13:44:32 +09:00
parent 300b6325a9
commit 0cc0caa8e1
5 changed files with 89 additions and 76 deletions
+3 -2
View File
@@ -8,6 +8,7 @@
const ERROR_TIMEOUT = 1000
module.exports = {
namespace: 'app',
state: {
error: [],
errorTimeDone: null,
@@ -33,9 +34,9 @@ module.exports = {
},
effects: {
error: function (action, state, send) {
const timeout = state.errorTimeDone - Date.now()
const timeout = state.app.errorTimeDone - Date.now()
setTimeout(function () {
send('error:delete')
send('app:error:delete')
}, timeout)
}
}