1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-02-22 04:52:03 +00:00
trezor-wallet/src/actions/SummaryActions.js
2018-09-06 17:04:28 +02:00

37 lines
772 B
JavaScript

/* @flow */
import * as SUMMARY from 'actions/constants/summary';
import { initialState } from 'reducers/SummaryReducer';
import type {
ThunkAction, Action, Dispatch,
} from 'flowtype';
import type { State } from 'reducers/SummaryReducer';
export type SummaryAction = {
type: typeof SUMMARY.INIT,
state: State
} | {
type: typeof SUMMARY.DISPOSE,
} | {
type: typeof SUMMARY.DETAILS_TOGGLE
}
export const init = (): ThunkAction => (dispatch: Dispatch): void => {
const state: State = {
...initialState,
};
dispatch({
type: SUMMARY.INIT,
state,
});
};
export const dispose = (): Action => ({
type: SUMMARY.DISPOSE,
});
export const onDetailsToggle = (): Action => ({
type: SUMMARY.DETAILS_TOGGLE,
});