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

reduxerit

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reduxerit - npm Package Compare versions

Comparing version 0.3.4 to 0.4.0

2

package.json
{
"name": "reduxerit",
"version": "0.3.4",
"version": "0.4.0",
"description": "redux utils to generate reducer and actions in a shorter way",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -59,3 +59,13 @@ import _deepmerge from 'deepmerge';

export const set = target => (state, action) => (setIn(state,target,action.payload ))
export const update = (target, updateCB) => (state, action) => (updateIn(state,target, (oldValue) => updateCB(oldValue, action.payload) ))
export const update = (target, updateCB) => (state, action) => {
let updateFinalCb;
if( typeof(updateCB) === 'function' )
updateFinalCb = (oldValue) => updateCB(oldValue, action.payload)
else
updateFinalCb = () => updateCB
return updateIn(state,target, updateFinalCb)
}
export const deepmerge = target => (state, action) => updateIn(state, target, (obj) => _deepmerge(obj, action.payload))

@@ -62,0 +72,0 @@ export const merge = target => (state, action) => updateIn(state, target, (obj) => ({...obj, ...action.payload}) )

@@ -222,3 +222,3 @@ import chai from 'chai';

/* update */
it("update - ", () =>{
it("update - update collaback", () =>{
const action = {

@@ -239,8 +239,23 @@ type:'TYPE',

it("remove - ", () =>{
it("update - set fixed value", () =>{
const action = {
type:'TYPE',
payload:5
type:'TYPE'
}
update(['b','c'] , 'settedWithoutCallback' )(state,action)
.should.be.deep.equal({
a: "aa",
b: {
c:"settedWithoutCallback",
d: "dd"
}
})
})
it("remove - remove b.c", () =>{
const action = {
type:'TYPE'
}
remove(['b','c'])(state,action)

@@ -247,0 +262,0 @@ .should.be.deep.equal({

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