UNPKG

2.07 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.asyncFetchPageSuccessOrFailureCase = exports.asyncAsyncSuccessOrFailureCase = exports.asyncAsyncRequestCase = exports.asyncFetchPageRequestCase = exports.asyncNavigationCase = void 0;
7
8var _actions = require("./actions");
9
10var _asyncReductions = require("./async-reductions");
11
12// eslint-disable-next-line no-unused-vars
13var asyncNavigationCase = function asyncNavigationCase(asyncState, payload) {
14 return [_actions.SHARYN_NAVIGATION, function () {
15 return (0, _asyncReductions.clearAsync)('page')(asyncState);
16 }];
17}; // eslint-disable-next-line no-unused-vars
18
19
20exports.asyncNavigationCase = asyncNavigationCase;
21
22var asyncFetchPageRequestCase = function asyncFetchPageRequestCase(asyncState, payload) {
23 return [_actions.SHARYN_FETCH_PAGE_REQUEST, function () {
24 return (0, _asyncReductions.setAsyncRequest)(asyncState, {
25 key: 'page'
26 });
27 }];
28};
29
30exports.asyncFetchPageRequestCase = asyncFetchPageRequestCase;
31
32var asyncAsyncRequestCase = function asyncAsyncRequestCase(asyncState, payload) {
33 return [_actions.SHARYN_ASYNC_REQUEST, function () {
34 return (0, _asyncReductions.setAsyncRequest)(asyncState, {
35 key: payload
36 });
37 }];
38};
39
40exports.asyncAsyncRequestCase = asyncAsyncRequestCase;
41
42var asyncAsyncSuccessOrFailureCase = function asyncAsyncSuccessOrFailureCase(asyncState, payload) {
43 return [[_actions.SHARYN_ASYNC_SUCCESS, _actions.SHARYN_ASYNC_FAILURE], function () {
44 return (0, _asyncReductions.delAsyncEntry)(payload.asyncKey)(asyncState);
45 }];
46}; // eslint-disable-next-line no-unused-vars
47
48
49exports.asyncAsyncSuccessOrFailureCase = asyncAsyncSuccessOrFailureCase;
50
51var asyncFetchPageSuccessOrFailureCase = function asyncFetchPageSuccessOrFailureCase(asyncState, payload) {
52 return [[_actions.SHARYN_FETCH_PAGE_SUCCESS, _actions.SHARYN_FETCH_PAGE_FAILURE], function () {
53 return (0, _asyncReductions.delAsyncEntry)('page')(asyncState);
54 }];
55};
56
57exports.asyncFetchPageSuccessOrFailureCase = asyncFetchPageSuccessOrFailureCase;
\No newline at end of file