UNPKG

fb-test-module

Version:

How to use: ``` import {store, getStore} from 'fb-test-module'; conf.DialogramApi = "API_BASE_URL"; conf.Platform = "mobile"; //use "web" if you are on webApp getStore(); //Inject store in your provider ``` and you'r readyt to go. # Base ## Act

31 lines (26 loc) 679 B
import { Status, SET_ENTITY, LOG_OUT } from './BaseType'; export const SuccessApiCall = (entity) => ({ type: `${entity} ${Status.Success}` }) export const FailureApiCall = (entity, code, message) => ({ type: `${entity} ${Status.Failure}`, payload: { data: { code, message } } }) export const LoadingApiCall = (entity) => ({ type: `${entity} ${Status.Loading}` }) export const setEntity = (action, response) => ({ ...action, type: `${action.payload.meta.entity} ${SET_ENTITY}`, payload: { data: response } }) export const Logout = () => ({ type: LOG_OUT, })