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
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,6 +207,8 @@ The URL to your endpoints are being constructed with **your domain name, your op
207
207
208
208
* The `queryParameters` are regular query string parameters. For instance, a request fired with this path : `/weather` and these `queryParameters` : `{ days: 'mon,tue,sun', location: 'Paris,France' }` will become `/weather?days=mon,tue,sun&location=Paris,France`.
209
209
210
+
> 💡 Pro-tip : Both query and path parameters can be undefined, in this case they simply won't be processed when generating your route. You don't have to create an intermediate variable holding your options to handle whether or not your variables are defined.
211
+
210
212
## Limiting the size of your cache
211
213
212
214
If you fear your cache will keep growing, you have some options to make sure it doesn't get too big.
@@ -219,7 +221,7 @@ The other solution would be to use the capping option. If you set `capServices`
219
221
220
222
Just like for the other request options, **you can provide middlewares at the global level in your API options, at the service's definition level, or in the `options` parameter of the `fetch` method.**
221
223
222
-
You must provide an **array of promises**, like so : `(serviceDefinition: IAPIService, fullPath: string, options: IFetchOptions) => any;`, please [take a look at the types](#types) to know more. You don't necessarily need to write asynchronous code in them, but they all must be promises.
224
+
You must provide an **array of promises**, like so : `(serviceDefinition: IAPIService, paths: IMiddlewarePaths, options: IFetchOptions) => any;`, please [take a look at the types](#types) to know more. You don't necessarily need to write asynchronous code in them, but they all must be promises.
223
225
224
226
Anything you will resolve in those promises will be merged into your request's options !
225
227
@@ -294,8 +296,8 @@ These are Typescript defintions, so they should be displayed in your editor/IDE
294
296
295
297
Pull requests are more than welcome for these items, or for any feature that might be missing.
296
298
297
-
-[x] Write a demo
298
299
-[ ] Improve capping performance by storing how many items are cached for each service so we don't have to parse the whole service's dictionary each time
299
300
-[ ] Add a method to check for the total size of the cache, which would be useful to trigger a clearing if it reaches a certain size
300
301
-[ ] Thoroughly test custom caching drivers, maybe provide one (realm or sqlite)
0 commit comments