0.9.1 • Published 4 years ago

@redux-tools/utils v0.9.1

Weekly downloads
216
License
MIT
Repository
github
Last release
4 years ago

@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

  1. prefix (string): Prefix to add to each value.
  2. 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"