@hulanbv/nest-utilities-client-state
Advanced tools
Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "@hulanbv/nest-utilities-client-state", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "React hooks for state management when using nest-utilities-client and a nest-utilities based API.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -25,2 +25,9 @@ # nest-utilities-client-state | ||
## How does it work? | ||
NUCS keeps a live state for every unique request hook you use. A request's uniqueness is determined by i.a. it's NUC service, endpoint and http options. | ||
For example, if you wanted to use a request state for fetching all users with name "Alex", you would use `useAll(userService, { filter: { name: { $eq: "Alex" }}})`. | ||
The request state's defining properties are `userService`, and query `name=Alex`. Under the hood, those properties are used to generate an identifier for this particular request state. If you were to implement another request hook with those exact same parameters, the already created request state will be used, because their identifiers are equal. Therefor that state could be shared by multiple components and/or compositions and their respectable states and views will be synchronized. | ||
## How to use & examples | ||
@@ -27,0 +34,0 @@ |
81507
533