Update README.md
Can't set namespace under `effects`.
This commit is contained in:
@@ -289,11 +289,12 @@ An example subscription that logs `"dog?"` every second:
|
|||||||
```js
|
```js
|
||||||
const app = choo()
|
const app = choo()
|
||||||
app.model({
|
app.model({
|
||||||
|
namespace: 'app',
|
||||||
subscriptions: [
|
subscriptions: [
|
||||||
(send) => setInterval(() => send('app:print', { payload: 'dog?' }), 1000)
|
(send) => setInterval(() => send('app:print', { payload: 'dog?' }), 1000)
|
||||||
],
|
],
|
||||||
effects: {
|
effects: {
|
||||||
'app:print': (action, state) => console.log(action.payload)
|
print: (action, state) => console.log(action.payload)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user