2017-07-13 21:02:39 +00:00
|
|
|
// @flow
|
|
|
|
import type { Token } from 'config/data';
|
|
|
|
|
2017-07-27 17:05:09 +00:00
|
|
|
/*** Add custom token ***/
|
2017-07-13 21:02:39 +00:00
|
|
|
export type AddCustomTokenAction = {
|
|
|
|
type: 'CUSTOM_TOKEN_ADD',
|
|
|
|
payload: Token
|
|
|
|
};
|
|
|
|
|
|
|
|
export function addCustomToken(payload: Token): AddCustomTokenAction {
|
|
|
|
return {
|
|
|
|
type: 'CUSTOM_TOKEN_ADD',
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-07-27 17:05:09 +00:00
|
|
|
/*** Remove Custom Token ***/
|
|
|
|
export type RemoveCustomTokenAction = {
|
|
|
|
type: 'CUSTOM_TOKEN_REMOVE',
|
|
|
|
payload: string
|
|
|
|
};
|
|
|
|
|
2017-07-13 21:02:39 +00:00
|
|
|
export function removeCustomToken(payload: string): RemoveCustomTokenAction {
|
|
|
|
return {
|
|
|
|
type: 'CUSTOM_TOKEN_REMOVE',
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
2017-07-27 17:05:09 +00:00
|
|
|
|
|
|
|
/*** Union Type ***/
|
|
|
|
export type CustomTokenAction = AddCustomTokenAction | RemoveCustomTokenAction;
|