How to use the @redux-saga/is.effect 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 clarketm / saga-monitor / src / modules / logSaga.js View on Github external
formatter.addLabel(winnerInd).addLabel(desc.label);

  if (desc.root) {
    formatter
      .addEffectType("root")
      .resetStyle()
      .addCall(desc.saga.name, desc.args)
      .addDescResult(desc);
  } else if (is.iterator(desc.effect)) {
    formatter.addValue(desc.effect.name).addDescResult(desc, true);
  } else if (is.promise(desc.effect)) {
    formatter
      .addEffectType("promise")
      .resetStyle()
      .addDescResult(desc);
  } else if (is.effect(desc.effect)) {
    const { type, payload } = desc.effect;

    if (type === effectTypes.TAKE) {
      formatter
        .addEffectType("take")
        .resetStyle()
        .addValue(payload.channel == null ? payload.pattern : payload)
        .addDescResult(desc);
    } else if (type === effectTypes.PUT) {
      formatter
        .addEffectType("put")
        .resetStyle()
        .addDescResult(Object.assign({}, desc, { result: payload }));
    } else if (type === effectTypes.ALL) {
      formatter
        .addEffectType("all")
github clarketm / saga-monitor / src / modules / checkers.js View on Github external
export const isRaceEffect = eff => is.effect(eff) && eff.type === effectTypes.RACE;
github redux-saga / redux-saga / packages / simple-saga-monitor / src / modules / logSaga.js View on Github external
formatter.addLabel(winnerInd).addLabel(desc.label)

  if (desc.root) {
    formatter
      .addEffectType('root')
      .resetStyle()
      .addCall(desc.saga.name, desc.args)
      .addDescResult(desc)
  } else if (is.iterator(desc.effect)) {
    formatter.addValue(desc.effect.name).addDescResult(desc, true)
  } else if (is.promise(desc.effect)) {
    formatter
      .addEffectType('promise')
      .resetStyle()
      .addDescResult(desc)
  } else if (is.effect(desc.effect)) {
    const { type, payload } = desc.effect

    if (type === effectTypes.TAKE) {
      formatter
        .addEffectType('take')
        .resetStyle()
        .addValue(payload.channel == null ? payload.pattern : payload)
        .addDescResult(desc)
    } else if (type === effectTypes.PUT) {
      formatter
        .addEffectType('put')
        .resetStyle()
        .addDescResult(Object.assign({}, desc, { result: payload }))
    } else if (type === effectTypes.ALL) {
      formatter
        .addEffectType('all')
github redux-saga / redux-saga / packages / simple-saga-monitor / src / modules / checkers.js View on Github external
export const isRaceEffect = eff => is.effect(eff) && eff.type === effectTypes.RACE
github redux-saga / redux-saga / packages / core / src / internal / io.js View on Github external
    check(fnDescriptor, arg => !is.effect(arg), 'fork: argument must not be an effect')
  }
github redux-saga / redux-saga / packages / core / src / internal / io.js View on Github external
const isForkEffect = eff => is.effect(eff) && eff.type === effectTypes.FORK