You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-wallet/src/actions/SummaryActions.js

38 lines
826 B

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