You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 29, 2023. It is now read-only.
@@ -15,11 +15,11 @@ The main target of the library are front-end applications, but it could be used
15
15
It helps you __providing async data__ to your components informing them about __loading and error states__.
16
16
It also provides a __cache layer__, so you don´t have to worry about when to read the data, and allows you to __combine the results of different data providers__ using a syntax very similar to the known [Reselect][reselect], recalculating them only when one of the dependencies cache is cleaned.
17
17
18
-
As its states are managed with [Redux][redux], you can take advantage of his large ecosystem of addons, which will improve the developer experience. _(You don't need to use Redux directly in your application if you don't want, the library includes its own internal store for that purpose, which [can be migrated to your own store][api-store-manager])._
18
+
As its states are managed with [Redux][redux], you can take advantage of his large ecosystem of addons, which will improve the developer experience. _(You don't need to use Redux directly in your application if you don't want, the library includes its own internal store for that purpose, which [can be migrated to your own store easily][api-store-manager] for debugging purposes, for example)._
19
19
20
-
You can use Data Provider with [React][react], or with any other view library. Separated addons are available for that purpose, as [@data-provider/react][data-provider-react].
20
+
You can use Data Provider with [React][react], or with any other view library. [Separated addons][addons] are available for that purpose, as [@data-provider/react][data-provider-react].
21
21
22
-
Data Provider is __agnostic about data origins__, so it can be used to read data from a REST API, from localStorage, or from any other origin. Choose one of the available plugins depending of the type of the origin you want to read from, as [@data-provider/axios][data-provider-axios], or [@data-provider/browser-storage][data-provider-browser-storage].
22
+
Data Provider is __agnostic about data origins__, so it can be used to read data from a REST API, from localStorage, or from any other origin. Choose one of the [available addons][addons] depending of the type of the origin you want to read from, as [@data-provider/axios][data-provider-axios], or [@data-provider/browser-storage][data-provider-browser-storage].
23
23
24
24
It has a __light weight__, 4.2KB gzipped in UMD format _(you have to add the Redux weight to this)_, and addons usually are even lighter.
25
25
@@ -32,16 +32,17 @@ We have a website available to help you to learn to use Data Provider. There are
32
32
*[Motivation][motivation]
33
33
*[Installation][installation]
34
34
*[Basic tutorial][basic-tutorial]
35
+
*[Addons][addons]
35
36
*[Recipes][recipes]
36
37
*[API reference][api-reference]
37
38
38
39
## Main features
39
40
40
41
### Agnostic about data origins
41
42
42
-
The Provider class provides the cache, state handler, etc., but not the "read" method. The "read" behavior is implemented by __different Data Provider Origins addons__.
43
+
The Provider class provides the cache, state handler, etc., but not the "read" method. The "read" behavior is implemented by __different [Data Provider Origins addons][addons]__.
43
44
44
-
There are different origins available, such as __[Axios][data-provider-axios], [LocalStorage][data-provider-browser-storage], [Memory][data-provider-memory], etc.__ and building your own is so easy as extending the Provider class with a custom "readMethod".
45
+
There are different origins addons available, such as __[Axios][data-provider-axios], [LocalStorage][data-provider-browser-storage], [Memory][data-provider-memory], etc.__ and building your own is so easy as extending the Provider class with a custom "readMethod".
45
46
46
47
Sharing the same interface for all origins, and being able to build Selectors combining all of them implies that your logic will be __completely isolated about WHERE the data is being retrieved.__
47
48
@@ -119,7 +120,7 @@ Providers and selectors instances can be queried, which returns a new child inst
119
120
120
121
Each different child has a different cache, different state, etc.
121
122
122
-
Different origins can use the "query" value for different purposes (API origins will normally use it for adding different params or query strings to the provider url)
123
+
Different origins can use the "query" value for different purposes (API origins will normally use it for adding different params or query strings to the provider url, for example)
123
124
124
125
When the parent provider cache is clean, also the children is. _(For example, cleaning the cache of an API origin requesting to "/api/books", will also clean the cache for "/api/books?author=2")_
125
126
@@ -147,26 +148,30 @@ export default Book;
147
148
148
149
Data Provider is not concerned about the views, but UI binding addons are available.
149
150
150
-
For example, the [@data-provider/react][data-provider-react] package __gives you HOCs to connect providers to your components__, creating a wrapper component handling all the logic for you.
151
+
For example, the [@data-provider/react][data-provider-react] package __gives you hooks to easily retrieve and provide data and other data-provider states to your components__,
151
152
152
-
It also provides __hooks like "useData", "useLoading", etc.__
153
+
It also provides __HOCs like "withData", "withLoading", etc., creating a wrapper component handling all the logic for you.__
153
154
154
-
__Optimized__, it takes care of reading the data and re-renders the component only when your desired props have changed.
155
+
__Optimized__, it takes care of reading the data and re-renders the component only when the provider desired props have changed. It also takes care of reading the data again every time the cache of the provider is invalidated.
0 commit comments