0.9.1 • Published 4 years ago
@redux-tools/utils v0.9.1
@redux-tools/utils
Various utility functions used throughout the packages, not explicitly tied to a domain.
API Reference
prefixedValueMirror
Works just like valueMirror
from ramda-extension, but adds a prefix to each value. Very useful for creating action types.
Arguments
prefix
(string): Prefix to add to each value.xs
(Array): Values to mirror and prefix.
Returns
(Object): Object with keys matching the passed values.
Example
import { prefixedValueMirror } from '@redux-tools/utils';
export const ActionTypes = prefixedValueMirror('duck', ['INCREMENT']);
ActionTypes.INCREMENT; // "duck/INCREMENT"