eventChannel
to emit certain external events. What I’d like to do is to just take
a certain pattern from it. I guess I’d have to do it like this:const chan = eventChannel(/* do stuff */);
while (true) {
const event = yield take(channel);
if (event.type === ’TYPE_THAT_I_WANT’) {
// Do a certain thing with an event here
}
}
eventChannel
does)
Note: messages on an eventChannel are not buffered by default. You have to provide a buffer to the eventChannel factory in order to specify buffering strategy for the channel (e.g. eventChannel(subscriber, buffer)). See the API docs for more info
try{ console.log('derp') } catch(err){console.log(err)}finally{console.log('yerp')}