How to use the @redux-saga/is.notUndef function in @redux-saga/is

To help you get started, we’ve selected a few @redux-saga/is examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
case is.notUndef((parsedEffect = asEffect.flush(effect))):
      return {
        type: FLUSH,
        effect: parsedEffect,
        providerKey: 'flush',
      };

    case is.notUndef((parsedEffect = asEffect.fork(effect))):
      return {
        type: FORK,
        effect: parsedEffect,
        providerKey: parsedEffect.detached ? 'spawn' : 'fork',
      };

    case is.notUndef((parsedEffect = asEffect.getContext(effect))):
      return {
        type: GET_CONTEXT,
        effect: parsedEffect,
        providerKey: 'getContext',
      };

    case is.notUndef((parsedEffect = asEffect.join(effect))):
      return {
        type: JOIN,
        effect: parsedEffect,
        providerKey: 'join',
      };

    case is.notUndef((parsedEffect = asEffect.select(effect))):
      return {
        type: SELECT,
github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
case is.notUndef((parsedEffect = asEffect.select(effect))):
      return {
        type: SELECT,
        effect: parsedEffect,
        providerKey: 'select',
      };

    case is.notUndef((parsedEffect = asEffect.setContext(effect))):
      return {
        type: SET_CONTEXT,
        effect: parsedEffect,
        providerKey: 'setContext',
      };

    case is.notUndef((parsedEffect = asEffect.actionChannel(effect))):
      return {
        type: ACTION_CHANNEL,
        effect: parsedEffect,
        providerKey: 'actionChannel',
      };

    case is.notUndef((parsedEffect = asEffect.all(effect))):
      return createAll(parsedEffect);

    default:
      return { type: NONE };
  }
}
github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
case is.notUndef((parsedEffect = asEffect.getContext(effect))):
      return {
        type: GET_CONTEXT,
        effect: parsedEffect,
        providerKey: 'getContext',
      };

    case is.notUndef((parsedEffect = asEffect.join(effect))):
      return {
        type: JOIN,
        effect: parsedEffect,
        providerKey: 'join',
      };

    case is.notUndef((parsedEffect = asEffect.select(effect))):
      return {
        type: SELECT,
        effect: parsedEffect,
        providerKey: 'select',
      };

    case is.notUndef((parsedEffect = asEffect.setContext(effect))):
      return {
        type: SET_CONTEXT,
        effect: parsedEffect,
        providerKey: 'setContext',
      };

    case is.notUndef((parsedEffect = asEffect.actionChannel(effect))):
      return {
        type: ACTION_CHANNEL,
github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
case is.notUndef((parsedEffect = asEffect.cancel(effect))):
      return {
        type: CANCEL,
        effect: parsedEffect,
        providerKey: 'cancel',
      };

    case is.notUndef((parsedEffect = asEffect.cancelled(effect))):
      return {
        type: CANCELLED,
        effect: parsedEffect,
        providerKey: 'cancelled',
      };

    case is.notUndef((parsedEffect = asEffect.cps(effect))):
      return {
        type: CPS,
        effect: parsedEffect,
        providerKey: 'cps',
      };

    case is.notUndef((parsedEffect = asEffect.flush(effect))):
      return {
        type: FLUSH,
        effect: parsedEffect,
        providerKey: 'flush',
      };

    case is.notUndef((parsedEffect = asEffect.fork(effect))):
      return {
        type: FORK,
github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
type: PUT,
        effect: parsedEffect,
        providerKey: 'put',
      };

    case is.notUndef((parsedEffect = asEffect.race(effect))):
      return createRace(parsedEffect, { providerKey: 'race' });

    case is.notUndef((parsedEffect = asEffect.call(effect))):
      return {
        type: CALL,
        effect: parsedEffect,
        providerKey: 'call',
      };

    case is.notUndef((parsedEffect = asEffect.cancel(effect))):
      return {
        type: CANCEL,
        effect: parsedEffect,
        providerKey: 'cancel',
      };

    case is.notUndef((parsedEffect = asEffect.cancelled(effect))):
      return {
        type: CANCELLED,
        effect: parsedEffect,
        providerKey: 'cancelled',
      };

    case is.notUndef((parsedEffect = asEffect.cps(effect))):
      return {
        type: CPS,
github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
switch (true) {
    case is.notUndef((parsedEffect = asEffect.take(effect))):
      return {
        type: TAKE,
        effect: parsedEffect,
        providerKey: 'take',
      };

    case is.notUndef((parsedEffect = asEffect.put(effect))):
      return {
        type: PUT,
        effect: parsedEffect,
        providerKey: 'put',
      };

    case is.notUndef((parsedEffect = asEffect.race(effect))):
      return createRace(parsedEffect, { providerKey: 'race' });

    case is.notUndef((parsedEffect = asEffect.call(effect))):
      return {
        type: CALL,
        effect: parsedEffect,
        providerKey: 'call',
      };

    case is.notUndef((parsedEffect = asEffect.cancel(effect))):
      return {
        type: CANCEL,
        effect: parsedEffect,
        providerKey: 'cancel',
      };
github jfairbank / redux-saga-test-plan / src / expectSaga / parseEffect.js View on Github external
case is.notUndef((parsedEffect = asEffect.fork(effect))):
      return {
        type: FORK,
        effect: parsedEffect,
        providerKey: parsedEffect.detached ? 'spawn' : 'fork',
      };

    case is.notUndef((parsedEffect = asEffect.getContext(effect))):
      return {
        type: GET_CONTEXT,
        effect: parsedEffect,
        providerKey: 'getContext',
      };

    case is.notUndef((parsedEffect = asEffect.join(effect))):
      return {
        type: JOIN,
        effect: parsedEffect,
        providerKey: 'join',
      };

    case is.notUndef((parsedEffect = asEffect.select(effect))):
      return {
        type: SELECT,
        effect: parsedEffect,
        providerKey: 'select',
      };

    case is.notUndef((parsedEffect = asEffect.setContext(effect))):
      return {
        type: SET_CONTEXT,
github redux-saga / redux-saga / packages / core / src / internal / effectRunnerMap.js View on Github external
function runTakeEffect(env, { channel = env.channel, pattern, maybe }, cb) {
  const takeCb = input => {
    if (input instanceof Error) {
      cb(input, true)
      return
    }
    if (isEnd(input) && !maybe) {
      cb(TERMINATE)
      return
    }
    cb(input)
  }
  try {
    channel.take(takeCb, is.notUndef(pattern) ? matcher(pattern) : null)
  } catch (err) {
    cb(err, true)
    return
  }
  cb.cancel = takeCb.cancel
}