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
|
|
|
|
2019-03-04 12:33:02 +00:00
|
|
|
export type AccountAction =
|
|
|
|
| {
|
|
|
|
type: typeof ACCOUNT.FROM_STORAGE,
|
|
|
|
payload: State,
|
|
|
|
}
|
|
|
|
| {
|
|
|
|
type: typeof ACCOUNT.CREATE | typeof ACCOUNT.UPDATE,
|
|
|
|
payload: Account,
|
|
|
|
};
|
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
|
|
|
});
|