New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ramda-redux

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ramda-redux

A helper for reduce React Redux template code

  • 1.0.3
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

A helper for reduce React Redux template code.

This project is power by Ramda.js

How to use

  1. install ramda-redux

    npm install ramda-redux

  2. using ramda-redux for reduce template code.

How to test

npm run test

Generate API doc

npm run doc

API doc

Functions

Action(type, payload)Action

The Action constructor

Pattern(type, handler)Pattern

Pattern constructor for arguments of Matcher constructor

Matcher(...matcherList)Matcher

Matcher constructor

Reducer(initState, matcher)Reducer

Reducer constructor,return a some implement of React redux native reducer

Action(type, payload) ⇒ Action

The Action constructor

Kind: global function

ParamType
typestring
payloadany

Example

const incNumberAction=Action('incNumber')
const addNumber100Action=Action('addNumber',100)
store.dispatch(incNumberAction)
store.dispatch(addNumber100Action)

Pattern(type, handler) ⇒ Pattern

Pattern constructor for arguments of Matcher constructor

Kind: global function

ParamType
typestring
handlerfunction

Example

const incNumberPattern =Pattern(
	'incNumber',
	(state, payload) => R.over(
			R.lensProp('number'),
			R.inc,
			state
		)
)
const matcher=Matcher(incNumberPattern)

Matcher(...matcherList) ⇒ Matcher

Matcher constructor

Kind: global function

ParamType
...matcherListfunction

Example

const incNumberAction=Action('incNumber')
const incNumberPattern =Pattern(
	'incNumber',
	(state, payload) => R.over(
			R.lensProp('number'),
			R.inc,
			state
		)
)
const matcher=Matcher(incNumberPattern)

Reducer(initState, matcher) ⇒ Reducer

Reducer constructor,return a some implement of React redux native reducer

Kind: global function

ParamTypeDescription
initStateany(object commonly)
matcherMatcher

Example

const incNumberAction=Action('incNumber')
const incNumberPattern =Pattern(
	'incNumber',
	 R.over(
			R.lensProp('number'),
			R.inc
		)
)
const matcher=Matcher(incNumberPattern)
const reducer=Reducer(
	{number:0},
	matcher
)
const store = createStore(reducer)
store.dispatch(incNumberAction)
//=> store.state={n:1}

Keywords

FAQs

Package last updated on 10 Oct 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