William O'Beirne 1aad9d1c21 Standardize Redux Actions / Reducers (#95)
* Convert Swap to consistent style

* Generate wallet reducer cleanup.

* Confirm empty action in swap reducer

* Union types. Fix gen wallet collision

* Fix not using all actions in reducer. Added reducer state for is fetching from bity. Added todo to make that a loader.

* Readme instructions.

* Remove common action constants.

* Bring all actions and reducers inline with readme instructions.

* Readme fixes

* address comments
2017-07-27 12:05:09 -05:00

40 lines
679 B
JavaScript

// @flow
/*** Resolve ENS name ***/
export type ResolveEnsNameAction = {
type: 'ENS_RESOLVE',
payload: string
};
export function resolveEnsName(name: string): ResolveEnsNameAction {
return {
type: 'ENS_RESOLVE',
payload: name
};
}
/*** Cache ENS address ***/
export type CacheEnsAddressAction = {
type: 'ENS_CACHE',
payload: {
ensName: string,
address: string
}
};
export function cacheEnsAddress(
ensName: string,
address: string
): CacheEnsAddressAction {
return {
type: 'ENS_CACHE',
payload: {
ensName,
address
}
};
}
/*** Union Type ***/
export type EnsAction = ResolveEnsNameAction | CacheEnsAddressAction;