scope-types

1.1.2 • Public • Published

Scope Types

Helper function for scoping a list of action types.

Build Status Coverage Status Dependency Status devDependency Status JavaScript Style Guide

Installation

Using npm:
$ npm install scope-types

Using yarn:
$ yarn add scope-types

Usage

/* actionTypes.js */
import scopeTypes from 'scope-types'
 
const types = ['MY_WILD_TYPE', 'MY_SWELL_TYPE', 'MY_SLICK_TYPE']
const customScope = 'myThrillingScope'
const actionTypes = scopeTypes(types, customScope)
 
/*
actionTypes = {
  MY_WILD_TYPE: Symbol('myThrillingScope/MY_WILD_TYPE'),
  MY_SWELL_TYPE: Symbol('myThrillingScope/MY_SWELL_TYPE')
  MY_SLICK_TYPE: Symbol('myThrillingScope/MY_SLICK_TYPE')
}
*/
 
export default actionTypes

Usage With Redux Logger

If you are planning on using with Redux Logger be sure to look at this issue.

Package Sidebar

Install

npm i scope-types

Weekly Downloads

1

Version

1.1.2

License

GPL-3.0

Last publish

Collaborators

  • rongierlach