How to use the redux-saga/effects.takeLatest 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 owtf / owtf / owtf / webapp / src / containers / SettingsPage / saga.js View on Github external
export default function* configurationSaga() {
  // Watches for LOAD_CONFIGURATIONS actions and calls getConfigurations when one comes in.
  // By using `takeLatest` only the result of the latest API call is applied.
  // It returns task descriptor (just like fork) so we can continue execution
  // It will be cancelled automatically on component unmount
  yield takeLatest(LOAD_CONFIGURATIONS, getConfigurations);
  yield takeLatest(CHANGE_CONFIGURATIONS, patchConfigurations);
}
github kleros / tokens-on-trial / src / sagas / notifications / index.js View on Github external
export default function* notificationSaga() {
  // Listeners
  yield fork(pushNotificationsListener)

  // Notification
  yield takeLatest(
    notificationActions.notification.DELETE,
    lessduxSaga,
    {
      flow: 'delete',
      collection: notificationActions.notifications.self,
      find: ({ payload: { ID } }) => n => ID === n.ID
    },
    notificationActions.notification,
    null
  )
}
github rate-engineering / rate3-monorepo / packages / demo / token-swap / src / sagas / network.ts View on Github external
export default function* network() {
  yield takeLatest(networkActions.INIT_USER, getUserEthBalance);
  yield takeLatest(networkActions.INIT_USER, setR3);
  yield takeLatest(networkActions.SET_R3_INSTANCE, getUserStellarBalance);
  yield takeLatest(networkActions.SET_R3_INSTANCE, getIssuerStellarBalance);

  yield takeLatest(networkActions.INIT_ISSUER, getIssuerEthBalance);
  yield takeLatest(networkActions.INIT_ISSUER, setR3);

  yield takeLatest(issuerActions.FETCH_ETH_TO_STELLAR, fetchE2SFromStellar);
  yield takeLatest(issuerActions.FETCH_STELLAR_TO_ETH, fetchS2EFromEth);
  // yield takeLatest(networkActions.INIT_ISSUER, setUp);
}
github PaulLaux / eth-hot-wallet / app / containers / Header / saga.js View on Github external
export default function* defaultSaga() {
  yield takeLatest(LOAD_NETWORK, loadNetwork);
  // yield takeLatest(LOAD_NETWORK, checkFaucetApi);
  yield takeLatest(COMFIRM_SEND_TRANSACTION, confirmSendTransaction);
  yield takeLatest(SEND_TRANSACTION, SendTransaction);
  yield takeLatest(GET_EXCHANGE_RATES, getRates);

  yield takeLatest(CHECK_FAUCET, checkFaucetApi);
  yield takeLatest(ASK_FAUCET, askFaucetApi);


  /* poll check balances */
  yield [
    fork(watchPollData),
    takeLatest(CHECK_BALANCES, checkAllBalances),
  ];
  /* End of poll check balances */
}
github microsoft / fuse-webui / fuse-react-gen / examples / {{app}} / sagas / login.ts View on Github external
function* watchForLogin() {
  yield takeLatest(ActionNames.login.logIn, loginAzure);
}
github neos / neos-ui / packages / neos-ui-sagas / src / CR / NodeOperations / hideNode.js View on Github external
export default function * hideNode() {
    yield takeLatest(actionTypes.CR.Nodes.HIDE, function * performPropertyChange(action) {
        const contextPath = action.payload;

        markNodeAsHidden(contextPath);

        yield put(actions.Changes.persistChanges([{
            type: 'Neos.Neos.Ui:Property',
            subject: contextPath,
            payload: {
                propertyName: '_hidden',
                value: true
            }
        }]));
    });
    yield takeLatest(actionTypes.CR.Nodes.HIDE_MULTIPLE, function * performPropertyChange(action) {
        const contextPaths = action.payload;
        const changes = [...contextPaths].map(contextPath => {
github kumabook / bebop / src / sagas / popup.js View on Github external
function* watchQuit() {
  yield takeLatest('QUIT', close);
}
github Kamahl19 / react-starter / src / common / services / user / index.ts View on Github external
export function* userSaga() {
  yield takeLatest(loginActions.request, login);
  yield takeLatest(reloginAction, relogin);
}
github decentraland / builder / src / modules / deployment / sagas.ts View on Github external
export function* deploymentSaga() {
  yield takeLatest(DEPLOY_TO_POOL_REQUEST, handleDeployToPoolRequest)
  yield takeLatest(DEPLOY_TO_LAND_REQUEST, handleDeployToLandRequest)
  yield takeLatest(CLEAR_DEPLOYMENT_REQUEST, handleClearDeploymentRequest)
  yield takeLatest(QUERY_REMOTE_CID, handleQueryRemoteCID)
  yield takeLatest(ADD_ITEM, handleMarkDirty)
  yield takeLatest(DROP_ITEM, handleMarkDirty)
  yield takeLatest(RESET_ITEM, handleMarkDirty)
  yield takeLatest(DUPLICATE_ITEM, handleMarkDirty)
  yield takeLatest(DELETE_ITEM, handleMarkDirty)
  yield takeLatest(SET_GROUND, handleMarkDirty)
  yield takeLatest(UPDATE_TRANSFORM, handleMarkDirty)
  yield takeLatest(SET_PROJECT, handleMarkDirty)
  yield takeLatest(LOAD_DEPLOYMENTS_REQUEST, handleFetchDeploymentsRequest)
  yield takeLatest(AUTH_SUCCESS, handleAuthSuccess)
}
github samtecspg / articulate / ui / app / containers / AgentsPage / saga.js View on Github external
export default function* loadAgents() {
  yield takeLatest(LOAD_AGENTS, getAgents);
  yield takeLatest(LOAD_CONNECTIONS, getConnections);
  yield takeLatest(LOAD_CHANNELS, getChannels);
  yield takeLatest(EXPORT_AGENT, getAgentExport);
  yield takeLatest(IMPORT_AGENT, postAgentImport);
}