1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.asyncFetchPageSuccessOrFailureCase = exports.asyncAsyncSuccessOrFailureCase = exports.asyncAsyncRequestCase = exports.asyncFetchPageRequestCase = exports.asyncNavigationCase = void 0;
|
7 |
|
8 | var _actions = require("./actions");
|
9 |
|
10 | var _asyncReductions = require("./async-reductions");
|
11 |
|
12 |
|
13 | var asyncNavigationCase = function asyncNavigationCase(asyncState, payload) {
|
14 | return [_actions.SHARYN_NAVIGATION, function () {
|
15 | return (0, _asyncReductions.clearAsync)('page')(asyncState);
|
16 | }];
|
17 | };
|
18 |
|
19 |
|
20 | exports.asyncNavigationCase = asyncNavigationCase;
|
21 |
|
22 | var 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 |
|
30 | exports.asyncFetchPageRequestCase = asyncFetchPageRequestCase;
|
31 |
|
32 | var 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 |
|
40 | exports.asyncAsyncRequestCase = asyncAsyncRequestCase;
|
41 |
|
42 | var 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 | };
|
47 |
|
48 |
|
49 | exports.asyncAsyncSuccessOrFailureCase = asyncAsyncSuccessOrFailureCase;
|
50 |
|
51 | var 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 |
|
57 | exports.asyncFetchPageSuccessOrFailureCase = asyncFetchPageSuccessOrFailureCase; |
\ | No newline at end of file |