How to use the redux-saga/effects.spawn function in redux-saga

To help you get started, we’ve selected a few redux-saga 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 flow-typed / flow-typed / definitions / npm / redux-saga_v0.16.x / flow_v0.56.0- / test_redux-saga_0.16.x.js View on Github external
function contextSpawnTest() {
  const e0 = spawn([context, fn0]);
  const e1 = spawn([context, fn1], "1");
  const e2 = spawn([context, fn2], "1", 2);
  const e3 = spawn([context, fn3], "1", 2, "3");
  const e4 = spawn([context, fn4], "1", 2, "3", 4);
  const e5 = spawn([context, fn5], "1", 2, "3", 4, "5");
  const e6 = spawn([context, fn6], "1", 2, "3", 4, "5", 6);
  const e7 = spawn([context, fn7], "1", 2, "3", 4, "5", 6, "7");
  const e8 = spawn([context, fn8], "1", 2, "3", 4, "5", 6, "7", 8);
  const eClass = spawn([context, fn1], "1");
  const eSaga = spawn([context, s1], "1");

  // Args Test
  (e0.SPAWN.args: []);
  (e1.SPAWN.args: [string]);
  (e2.SPAWN.args: [string, number]);
  (e3.SPAWN.args: [string, number, string]);
  (e4.SPAWN.args: [string, number, string, number]);
  (e5.SPAWN.args: [string, number, string, number, string]);
  (e6.SPAWN.args: [string, number, string, number, string, number]);
  (e7.SPAWN.args: [string, number, string, number, string, number, string]);
  (e8.SPAWN.args: [string, number, string, number, string, number, string, number]);

  // Context Test
  (e1.SPAWN.context: typeof context);
  (e2.SPAWN.context: typeof context);
github uport-project / uport-mobile / lib / sagas / requests / index.js View on Github external
yield call(delay, 1000)
    }
    if (popup && AppState.currentState === 'active' && requestType !== 'information') {
      yield put(selectRequest(activityId))
    } else {
      yield put(updateBadgeCount())
      if (AppState.currentState !== 'active' && legacyPush && Platform.OS === 'ios') {
        yield put(sendLocalNotification(activityId, 'You received a message'))
      }
    }

    yield put(track(`request ${requestType}`))
    if (requestType === 'attestation') {
      const attResponse = yield call(addAttestations, request, parsed)
      if (request.callback_url && postback) {
        yield spawn(performCallback, request, attResponse)
      }
      return attResponse
    }
    const handler = HANDLERS[requestType]
    if (handler) {
      return yield call(handler.handleLegacy, request, parsed)
    }
  } catch (e) {
    console.log('error in handleURL')
    console.log(e)
  }
}
github brookshi / Hitchhiker / client / src / action / index.ts View on Github external
spawn(sendRequestForParam),
        spawn(saveRecord),
        spawn(saveAsRecord),
        spawn(deleteRecord),
        spawn(moveRecord),
        spawn(saveProject),
        spawn(quitProject),
        spawn(disbandProject),
        spawn(delProjectFile),
        spawn(saveLocalhostMapping),
        spawn(saveGlobalFunction),
        spawn(removeUser),
        spawn(inviteMember),
        spawn(saveEnvironment),
        spawn(delEnvironment),
        spawn(saveSchedule),
        spawn(deleteSchedule),
        spawn(getScheduleRecordsInPage),
        spawn(runSchedule),
        spawn(saveStress),
        spawn(deleteStress),
        spawn(runStress),
        spawn(syncUserData),
        spawn(sync)
    ];
};
github mlaursen / react-md / documentation / src / sagas / index.js View on Github external
export default function* sagas() {
  yield all([
    spawn(docgens),
    spawn(sassdocs),
    spawn(search),
    spawn(themes),
    spawn(github),
    spawn(airQuality),
  ]);
}
github brookshi / Hitchhiker / client / src / action / index.ts View on Github external
spawn(findPassword),
        spawn(changePassword),
        spawn(fetchLocalData),
        spawn(storeLocalData),
        spawn(deleteCollection),
        spawn(saveCollection),
        spawn(importData),
        spawn(sendRequest),
        spawn(sendRequestForParam),
        spawn(saveRecord),
        spawn(saveAsRecord),
        spawn(deleteRecord),
        spawn(moveRecord),
        spawn(saveProject),
        spawn(quitProject),
        spawn(disbandProject),
        spawn(delProjectFile),
        spawn(saveLocalhostMapping),
        spawn(saveGlobalFunction),
        spawn(removeUser),
        spawn(inviteMember),
        spawn(saveEnvironment),
        spawn(delEnvironment),
        spawn(saveSchedule),
        spawn(deleteSchedule),
        spawn(getScheduleRecordsInPage),
        spawn(runSchedule),
        spawn(saveStress),
        spawn(deleteStress),
        spawn(runStress),
        spawn(syncUserData),
        spawn(sync)
github RodionChachura / simple-blog-front / src / sagas / generic.js View on Github external
export function* startApp() {
  window.history.pushState({}, '', '')
  
  yield spawn(listenNotifications)

  function* ticking() {
    yield put(tickAction())
    yield call(delay, TICK)
    yield* ticking()
  }
  yield* ticking()
}
github brookshi / Hitchhiker / client / src / action / index.ts View on Github external
spawn(saveCollection),
        spawn(importData),
        spawn(sendRequest),
        spawn(sendRequestForParam),
        spawn(saveRecord),
        spawn(saveAsRecord),
        spawn(deleteRecord),
        spawn(moveRecord),
        spawn(saveProject),
        spawn(quitProject),
        spawn(disbandProject),
        spawn(delProjectFile),
        spawn(saveLocalhostMapping),
        spawn(saveGlobalFunction),
        spawn(removeUser),
        spawn(inviteMember),
        spawn(saveEnvironment),
        spawn(delEnvironment),
        spawn(saveSchedule),
        spawn(deleteSchedule),
        spawn(runSchedule),
        spawn(saveStress),
        spawn(deleteStress),
        spawn(runStress),
        spawn(stopStress),
        spawn(syncUserData),
        spawn(sync)
    ];
};