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

@ngneat/elf

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngneat/elf - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

index.d.ts

@@ -10,2 +10,2 @@ export { Store, Reducer, StoreValue, StoreDef, ReducerContext, } from './lib/store';

export { StateOf, Query, OrArray } from './lib/types';
export { setProp } from './lib/mutations';
export { setProp, setProps } from './lib/mutations';

@@ -344,3 +344,28 @@ import { Subject, BehaviorSubject, Observable, pipe, asapScheduler } from 'rxjs';

}
/**
*
* Update a root property of the state
*
* @example
*
* store.update(setProps({ count: 1, bar: 'baz'}))
*
* @example
*
* store.update(setProps(state => ({
* count: 1,
* nested: {
* ...state.nested,
* foo: 'bar'
* }
* })))
*
*/
export { Store, asap, capitalize, coerceArray, createState, distinctUntilArrayItemChanged, filterNil, getRegistry, getStore, getStoresSnapshot, head, isFunction, isObject, isString, isUndefined, propsArrayFactory, propsFactory, registry$, select, setProp, withProps };
function setProps(props) {
return function (state) {
return Object.assign({}, state, isFunction(props) ? props(state) : props);
};
}
export { Store, asap, capitalize, coerceArray, createState, distinctUntilArrayItemChanged, filterNil, getRegistry, getStore, getStoresSnapshot, head, isFunction, isObject, isString, isUndefined, propsArrayFactory, propsFactory, registry$, select, setProp, setProps, withProps };

@@ -434,3 +434,28 @@ (function (global, factory) {

}
/**
*
* Update a root property of the state
*
* @example
*
* store.update(setProps({ count: 1, bar: 'baz'}))
*
* @example
*
* store.update(setProps(state => ({
* count: 1,
* nested: {
* ...state.nested,
* foo: 'bar'
* }
* })))
*
*/
function setProps(props) {
return function (state) {
return __assign(__assign({}, state), isFunction(props) ? props(state) : props);
};
}
exports.Store = Store;

@@ -456,2 +481,3 @@ exports.asap = asap;

exports.setProp = setProp;
exports.setProps = setProps;
exports.withProps = withProps;

@@ -458,0 +484,0 @@

@@ -16,1 +16,21 @@ import { Reducer } from './store';

export declare function setProp<S extends Record<string, any>, K extends keyof S>(key: K, value: S[K] | ((current: S[K]) => S[K])): Reducer<S>;
/**
*
* Update a root property of the state
*
* @example
*
* store.update(setProps({ count: 1, bar: 'baz'}))
*
* @example
*
* store.update(setProps(state => ({
* count: 1,
* nested: {
* ...state.nested,
* foo: 'bar'
* }
* })))
*
*/
export declare function setProps<S extends Record<string, any>, V extends Partial<S>>(props: V | ((state: S) => V)): Reducer<S>;
{
"name": "@ngneat/elf",
"version": "1.1.0",
"version": "1.2.0",
"description": "A reactive state management for JS applications",

@@ -5,0 +5,0 @@ "publishConfig": {

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