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

redux-rubberstamp

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-rubberstamp

Pattern for hosting multiple versions of a component tree inside the main state tree

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by300%
Maintainers
4
Weekly downloads
 
Created
Source
Redux Rubberstamp Build Status Code Climate Code Coverage

Pattern for hosting multiple versions of a component tree inside the main state tree

Installation

Install with npm or yarn:

npm install --save redux-rubberstamp

Usage

Using redux-rubberstamp in your application is easy:

If you only need one instance of the component in your state tree, you can export it as a singleton component:

import { Singleton } from 'redux-rubberstamp'
import reducer from './reducer'
import button from './button'
import * as actions from './actions'
import * as selectors from './selectors'

export default Singleton({
  namespace: 'button',
  component: button,
  reducer,
  actions,
  selectors
})

If you only need multiple instances of the component in your state tree, you can export it as a factory component:

import { Factory } from 'redux-rubberstamp'
import reducer from './reducer'
import button from './button'
import * as actions from './actions'
import * as selectors from './selectors'

export default Factory({
  namespace: 'button',
  component: button,
  reducer,
  actions,
  selectors
})

When you use the component in your react app, you treat it like any default export:

import Button from './components/button'

const () => {
  return <Button />
}

In order to manage the master state tree, redux-rubberstamp provides a custom combineReducers function to manage the components place in the state tree:

import { combineReducers } from 'redux-rubberstamp'
import Button from './button'

export default combineReducers([
  Button
])

Keywords

FAQs

Package last updated on 28 Oct 2022

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