Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bufferapp/keywrapper

Package Overview
Dependencies
Maintainers
12
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufferapp/keywrapper

Wrap up your Redux Actions in a namespace bow

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
337
increased by214.95%
Maintainers
12
Weekly downloads
 
Created
Source

@bufferapp/keywrapper

npm version Build Status

A quick way to wrap your Redux actions in a namespace.

When dealing with larger Redux applications, this can help avoid generic action names from causing side effects. This will return an object with namespaced string constants given a string namespace and an Object or Array. See usage examples below for more info.

Install

npm install @bufferapp/keywrapper

Usage

import keyWrapper from '@bufferapp/keywrapper'

// Use an Object...
const actions = keyWrapper('QUEUE', {
  POST_DELETE: 0,
  POST_SHARE_NOW: 0
})

// ...or an Array
const otherActions = keyWrapper('QUEUE', [
  'POST_DELETE',
  'POST_SHARE_NOW'
])

console.log(actions)
/*
{
  POST_DELETE: 'QUEUE__POST_DELETE',
  POST_SHARE_NOW: 'QUEUE__POST_SHARE_NOW',
}
*/

License

MIT

Keywords

FAQs

Package last updated on 22 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc