@ngneat/elf
Advanced tools
Comparing version 2.3.1 to 2.3.2
59
index.js
@@ -146,3 +146,5 @@ import { BehaviorSubject, Subject, Observable, pipe, asapScheduler } from 'rxjs'; | ||
if (hasChange) { | ||
observer.next(buffer); | ||
observer.next({ | ||
...buffer | ||
}); | ||
hasChange = false; | ||
@@ -233,5 +235,6 @@ } | ||
return function (state) { | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: isFunction(value) ? value(state[key]) : value | ||
}); | ||
}; | ||
}; | ||
@@ -260,3 +263,6 @@ } | ||
return function (state) { | ||
return Object.assign({}, state, isFunction(props) ? props(state) : props); | ||
return { | ||
...state, | ||
...(isFunction(props) ? props(state) : props) | ||
}; | ||
}; | ||
@@ -315,5 +321,6 @@ } | ||
} | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: newVal | ||
}); | ||
}; | ||
}; | ||
@@ -327,5 +334,9 @@ }, | ||
} | ||
return Object.assign({}, state, { | ||
[key]: isObject(newVal) ? Object.assign({}, state[key], newVal) : newVal | ||
}); | ||
return { | ||
...state, | ||
[key]: isObject(newVal) ? { | ||
...state[key], | ||
...newVal | ||
} : newVal | ||
}; | ||
}; | ||
@@ -335,5 +346,6 @@ }, | ||
return function (state) { | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: initialValue | ||
}); | ||
}; | ||
}; | ||
@@ -353,8 +365,10 @@ }, | ||
const base = propsFactory(key, options); | ||
return Object.assign({}, base, { | ||
return { | ||
...base, | ||
[`add${normalizedKey}`](items) { | ||
return function (state) { | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: arrayAdd(state[key], items) | ||
}); | ||
}; | ||
}; | ||
@@ -364,5 +378,6 @@ }, | ||
return function (state) { | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: arrayRemove(state[key], items) | ||
}); | ||
}; | ||
}; | ||
@@ -372,5 +387,6 @@ }, | ||
return function (state) { | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: arrayToggle(state[key], items) | ||
}); | ||
}; | ||
}; | ||
@@ -380,5 +396,6 @@ }, | ||
return function (state) { | ||
return Object.assign({}, state, { | ||
return { | ||
...state, | ||
[key]: arrayUpdate(state[key], predicateOrIds, obj) | ||
}); | ||
}; | ||
}; | ||
@@ -389,3 +406,3 @@ }, | ||
} | ||
}); | ||
}; | ||
} | ||
@@ -392,0 +409,0 @@ function arrayAdd(arr, items) { |
{ | ||
"name": "@ngneat/elf", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "A reactive state management for JS applications", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36710
1069