UNPKG

sharyn

Version:

Combines all the other packages under one.

57 lines (42 loc) 2.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.asyncFetchPageSuccessOrFailureCase = exports.asyncAsyncSuccessOrFailureCase = exports.asyncAsyncRequestCase = exports.asyncFetchPageRequestCase = exports.asyncNavigationCase = void 0; var _actions = require("./actions"); var _asyncReductions = require("./async-reductions"); // eslint-disable-next-line no-unused-vars var asyncNavigationCase = function asyncNavigationCase(asyncState, payload) { return [_actions.SHARYN_NAVIGATION, function () { return (0, _asyncReductions.clearAsync)('page')(asyncState); }]; }; // eslint-disable-next-line no-unused-vars exports.asyncNavigationCase = asyncNavigationCase; var asyncFetchPageRequestCase = function asyncFetchPageRequestCase(asyncState, payload) { return [_actions.SHARYN_FETCH_PAGE_REQUEST, function () { return (0, _asyncReductions.setAsyncRequest)(asyncState, { key: 'page' }); }]; }; exports.asyncFetchPageRequestCase = asyncFetchPageRequestCase; var asyncAsyncRequestCase = function asyncAsyncRequestCase(asyncState, payload) { return [_actions.SHARYN_ASYNC_REQUEST, function () { return (0, _asyncReductions.setAsyncRequest)(asyncState, { key: payload }); }]; }; exports.asyncAsyncRequestCase = asyncAsyncRequestCase; var asyncAsyncSuccessOrFailureCase = function asyncAsyncSuccessOrFailureCase(asyncState, payload) { return [[_actions.SHARYN_ASYNC_SUCCESS, _actions.SHARYN_ASYNC_FAILURE], function () { return (0, _asyncReductions.delAsyncEntry)(payload.asyncKey)(asyncState); }]; }; // eslint-disable-next-line no-unused-vars exports.asyncAsyncSuccessOrFailureCase = asyncAsyncSuccessOrFailureCase; var asyncFetchPageSuccessOrFailureCase = function asyncFetchPageSuccessOrFailureCase(asyncState, payload) { return [[_actions.SHARYN_FETCH_PAGE_SUCCESS, _actions.SHARYN_FETCH_PAGE_FAILURE], function () { return (0, _asyncReductions.delAsyncEntry)('page')(asyncState); }]; }; exports.asyncFetchPageSuccessOrFailureCase = asyncFetchPageSuccessOrFailureCase;