How to use the @redux-saga/core/effects.fork function in @redux-saga/core

To help you get started, we’ve selected a few @redux-saga/core 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 Jameskmonger / creature-chess / src / shared / match / match.ts View on Github external
const rootSaga = function*() {
            yield all([
                yield fork(battle, _this.turnSimulator, _this.turnCount, _this.turnDuration),
                yield takeEvery(
                    BATTLE_FINISHED,
                    function*() {
                        _this.onServerFinishMatch();
                    }
                )
            ]);
        };
github Jameskmonger / creature-chess / src / shared / game / player / playerBoard.ts View on Github external
const rootSaga = function*() {
        yield all([
            yield fork(evolutionSagaFactory())
        ]);
    };
github Jameskmonger / creature-chess / src / app / sagas / actions / notifications.ts View on Github external
export const notifications = function*() {
    yield all([
        yield fork(sendNotifications),
        yield fork(clearNotifications)
    ]);
};
github Jameskmonger / creature-chess / src / app / store / sagas / actions / networking.ts View on Github external
yield put(joinLobbyAction(
                response.playerId,
                response.lobbyId,
                response.players,
                response.startTimestamp,
                response.isHost
            ));
            break;
        }

        yield put(joinGameError(error));
        action = yield take([FIND_GAME, JOIN_GAME, CREATE_GAME]);
    }

    yield fork(writeActionsToPackets);
    yield fork(writePacketsToSocket, socket);
};
github Jameskmonger / creature-chess / src / app / store / sagas / actions / networking.ts View on Github external
if (!error) {
            yield put(joinLobbyAction(
                response.playerId,
                response.lobbyId,
                response.players,
                response.startTimestamp,
                response.isHost
            ));
            break;
        }

        yield put(joinGameError(error));
        action = yield take([FIND_GAME, JOIN_GAME, CREATE_GAME]);
    }

    yield fork(writeActionsToPackets);
    yield fork(writePacketsToSocket, socket);
};
github Jameskmonger / creature-chess / src / app / store / sagas / index.ts View on Github external
export const rootSaga = function*() {
    yield all([
        yield fork(networking),
        yield fork(phaseTimer),
        yield fork(lobbyTimer),
        yield fork(announcement),
        yield fork(gamePhase),
        yield fork(preventAccidentalClose),
        yield fork(cardShop),
        yield fork(evolutionSagaFactory()),
        yield fork(battle, new TurnSimulator(new DefinitionProvider()), DEFAULT_TURN_COUNT, DEFAULT_TURN_DURATION)
    ]);
};
github Jameskmonger / creature-chess / src / app / store / sagas / index.ts View on Github external
export const rootSaga = function*() {
    yield all([
        yield fork(networking),
        yield fork(phaseTimer),
        yield fork(lobbyTimer),
        yield fork(announcement),
        yield fork(gamePhase),
        yield fork(preventAccidentalClose),
        yield fork(cardShop),
        yield fork(evolutionSagaFactory()),
        yield fork(battle, new TurnSimulator(new DefinitionProvider()), DEFAULT_TURN_COUNT, DEFAULT_TURN_DURATION)
    ]);
};
github Jameskmonger / creature-chess / src / app / sagas / actions / notifications.ts View on Github external
export const notifications = function*() {
    yield all([
        yield fork(sendNotifications),
        yield fork(clearNotifications)
    ]);
};
github Jameskmonger / creature-chess / src / app / store / sagas / index.ts View on Github external
export const rootSaga = function*() {
    yield all([
        yield fork(networking),
        yield fork(phaseTimer),
        yield fork(lobbyTimer),
        yield fork(announcement),
        yield fork(gamePhase),
        yield fork(preventAccidentalClose),
        yield fork(cardShop),
        yield fork(evolutionSagaFactory()),
        yield fork(battle, new TurnSimulator(new DefinitionProvider()), DEFAULT_TURN_COUNT, DEFAULT_TURN_DURATION)
    ]);
};
github Jameskmonger / creature-chess / src / app / store / sagas / index.ts View on Github external
export const rootSaga = function*() {
    yield all([
        yield fork(networking),
        yield fork(phaseTimer),
        yield fork(lobbyTimer),
        yield fork(announcement),
        yield fork(gamePhase),
        yield fork(preventAccidentalClose),
        yield fork(cardShop),
        yield fork(evolutionSagaFactory()),
        yield fork(battle, new TurnSimulator(new DefinitionProvider()), DEFAULT_TURN_COUNT, DEFAULT_TURN_DURATION)
    ]);
};