screenActions.js
743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
import ReactNative from 'react-native';
const {
SET_DATASOURCE,
SET_SELECTLIST,
CANCEL_SELECT,
} = require('../../constants/actionTypes').default;
export function updateDataSource(data) {
return {
type: SET_DATASOURCE,
payload: data
};
}
export function setSelectItem(list) {
return {
type: SET_SELECTLIST,
payload: list
};
}
export function cancelSelectDispath(json) {
return {
type: CANCEL_SELECT,
payload: json
};
}
export function cancelSelect() {
return (dispatch, getState) => {
let {app, screen} = getState();
let {origincategoryFilterList} = screen;
let json = origincategoryFilterList?origincategoryFilterList.toJS():[];
dispatch(cancelSelectDispath(json));
};
}