@laserware/stasis
    Preparing search index...

    Function actionChannel

    • Creates an effect that instructs the middleware to queue the actions matching pattern using an event channel. Optionally, you can provide a buffer to control buffering of the queued actions.

      The following code creates a channel to buffer all USER_REQUEST actions. Note that even the Saga may be blocked on the call effect. All actions that come while it's blocked are automatically buffered. This causes the Saga to execute the API calls one at a time

      import { actionChannel, call } from 'redux-saga/effects' import api from '...'

      function* takeOneAtMost() { const chan = yield actionChannel('USER_REQUEST') while (true) { const {payload} = yield take(chan) yield call(api.getUser, payload) } }

      Parameters

      • pattern: ActionPattern

        see API for take(pattern)

      • Optionalbuffer: Buffer<Action>

        a Buffer object

      Returns ActionChannelEffect