@ngneat/elf
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0-beta.2
export { Store, Reducer, StoreValue, StoreDef, ReducerContext, } from './lib/store'; | ||
export { propsFactory } from './lib/props-factory'; | ||
export { propsArrayFactory } from './lib/props-array-factory'; | ||
export { select, head, asap, distinctUntilArrayItemChanged, } from './lib/operators'; | ||
export { select, head, asap, filterNil, distinctUntilArrayItemChanged, } from './lib/operators'; | ||
export { getStore, getRegistry, registry$, getStoresSnapshot, } from './lib/registry'; | ||
@@ -6,0 +6,0 @@ export { withProps } from './lib/props.state'; |
@@ -6,1 +6,2 @@ import { MonoTypeOperatorFunction, OperatorFunction } from 'rxjs'; | ||
export declare const asap: <T>() => MonoTypeOperatorFunction<T>; | ||
export declare function filterNil<T>(): OperatorFunction<T, NonNullable<T>>; |
import { BehaviorSubject, Observable } from 'rxjs'; | ||
export declare type ReducerContext = { | ||
config: Record<PropertyKey, any>; | ||
}; | ||
export declare type StoreValue<T extends Store> = ReturnType<T['getValue']>; | ||
export declare type Reducer<State> = (state: State, context: ReducerContext) => State; | ||
export interface StoreDef<State = any> { | ||
name: string; | ||
state: State; | ||
config: any; | ||
} | ||
export declare class Store<SDef extends StoreDef = any, State = SDef['state']> extends BehaviorSubject<State> { | ||
storeDef: SDef; | ||
private storeDef; | ||
initialState: State; | ||
@@ -30,1 +20,11 @@ private context; | ||
} | ||
export declare type ReducerContext = { | ||
config: Record<PropertyKey, any>; | ||
}; | ||
export declare type StoreValue<T extends Store> = ReturnType<T['getValue']>; | ||
export declare type Reducer<State> = (state: State, context: ReducerContext) => State; | ||
export interface StoreDef<State = any> { | ||
name: string; | ||
state: State; | ||
config: any; | ||
} |
{ | ||
"name": "@ngneat/elf", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"description": "A reactive state management for JS applications", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
import { Subject, BehaviorSubject, Observable, pipe, asapScheduler } from 'rxjs'; | ||
import { map, distinctUntilChanged, debounceTime } from 'rxjs/operators'; | ||
import { map, distinctUntilChanged, debounceTime, filter } from 'rxjs/operators'; | ||
@@ -147,2 +147,5 @@ const registry = new Map(); | ||
const asap = () => debounceTime(0, asapScheduler); | ||
function filterNil() { | ||
return filter(value => value !== null && value !== undefined); | ||
} | ||
@@ -322,2 +325,2 @@ function coerceArray(value) { | ||
export { Store, asap, capitalize, coerceArray, createState, distinctUntilArrayItemChanged, getRegistry, getStore, getStoresSnapshot, head, isFunction, isObject, isString, isUndefined, propsArrayFactory, propsFactory, registry$, select, withProps }; | ||
export { Store, asap, capitalize, coerceArray, createState, distinctUntilArrayItemChanged, filterNil, getRegistry, getStore, getStoresSnapshot, head, isFunction, isObject, isString, isUndefined, propsArrayFactory, propsFactory, registry$, select, withProps }; |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'rxjs', 'rxjs/operators'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Store = {}, global.rxjs, global.operators)); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Store = {}, global.Rx, global.Rx)); | ||
}(this, (function (exports, rxjs, operators) { 'use strict'; | ||
@@ -244,2 +244,7 @@ | ||
}; | ||
function filterNil() { | ||
return operators.filter(function (value) { | ||
return value !== null && value !== undefined; | ||
}); | ||
} | ||
@@ -422,2 +427,3 @@ function coerceArray(value) { | ||
exports.distinctUntilArrayItemChanged = distinctUntilArrayItemChanged; | ||
exports.filterNil = filterNil; | ||
exports.getRegistry = getRegistry; | ||
@@ -424,0 +430,0 @@ exports.getStore = getStore; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
31641
751
76
0