screenActions.js 743 Bytes
'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));
	};
}