I'm noticing in the choo docs subscriptions is referred to as an array:
subscriptions: [
(send, done) => {
setInterval(() => {
send('app:print', { payload: 'dog?', myOtherValue: 1000 }, (err) => {
if (err) return done(err)
})
}, 1000)
}
]
But in the barracks docs it's a plain object with named keys:
subscriptions: {
emitWoofs: (send, done) => {
// emit a woof every second
setInterval(() => send('printWoofs', { woof: 'meow?' }, done), 1000)
}
}
I've seen it referred to both ways -- so which should it be?
Bonus question: if subscriptions is an object, do key names have any bearing on other aspects (reducers, effects, actions)?
So it used to be an array, but became an object in v3. This was done for consistency and making sure the names showed up correctly in debug output. PRs to fix docs welcome! :sparkles:
wow, that's weird, i'm using an array and it still works 😨
Yep I am using an array as well and thought that was the only way
lol, javascript
think this is resolved - closing!
needs to be fixed in template-basic 😄
It should be an object (:
On Sun, Jan 15, 2017 at 12:09 AM Haroen Viaene notifications@github.com
wrote:
needs to be fixed in template-basic 😄
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/yoshuawuyts/choo/issues/217#issuecomment-272660216,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACWler8wGyvT1iljwWu7PBCK2imR7P4Kks5rSVWrgaJpZM4Jfs7X
.
Most helpful comment
lol, javascript