a4-store
7 Store for state management
How-To
Install
npm install a4-store
app.store.ts
;;
my-sample.component.ts
;;;
Difference between .map and .select
Select will only fire the subscription when the current alue is different than the last while Map will fire the subscription when there is a new value set in the store.
Immutable Methods (protected)
These immutable methods can only be used within the store class.
immutableReplaceElement
Returning a new array with element at index being replaced by newElement.
immutableReplaceElementarray: T, newElement: T, index: number: T
immutableRemoveElement
Returning a new array with element at index being removed.
immutableRemoveElementarray: T, index: number: T
immutableInsertElement
Returning a new array with element being inserted at specified index.
immutableInsertElementarray: T, element: T, index: number: T
immutablePrependElement
Returning a new array with element inserted at the start (first element) of the given array.
immutablePrependElementarray: T, element: T: T
immutableAppendElement
Returning a new array with element inserted at the end (last element) of the given array.
immutableAppendElement<T>(array: T[], element: T): T[]