2018-04-16 21:19:50 +00:00
|
|
|
/* @flow */
|
|
|
|
|
2018-08-14 13:18:16 +00:00
|
|
|
import * as ACCOUNT from 'actions/constants/account';
|
2018-09-23 06:49:43 +00:00
|
|
|
import type { Action } from 'flowtype';
|
2018-09-12 11:25:21 +00:00
|
|
|
import type { Account, State } from 'reducers/AccountsReducer';
|
2018-04-16 21:19:50 +00:00
|
|
|
|
2018-12-21 09:58:53 +00:00
|
|
|
export type AccountAction = {
|
2018-05-10 12:40:25 +00:00
|
|
|
type: typeof ACCOUNT.FROM_STORAGE,
|
2018-04-23 10:20:15 +00:00
|
|
|
payload: State
|
2018-12-21 09:58:53 +00:00
|
|
|
} | {
|
|
|
|
type: typeof ACCOUNT.CREATE | typeof ACCOUNT.UPDATE,
|
2018-09-12 11:25:21 +00:00
|
|
|
payload: Account,
|
2018-12-21 09:58:53 +00:00
|
|
|
};
|
2018-09-12 11:25:21 +00:00
|
|
|
|
|
|
|
export const update = (account: Account): Action => ({
|
|
|
|
type: ACCOUNT.UPDATE,
|
2018-09-23 06:49:43 +00:00
|
|
|
payload: account,
|
2018-09-12 11:25:21 +00:00
|
|
|
});
|