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
Pass an Object to `Pokedex.init()` in order to configure it. Available options: `protocol`, `hostName`, `versionPath`, `cache`, `timeout`(ms), and `cacheImages`.
68
-
Any option is optional :smile:. All the default values can be found [here](https://github.com/PokeAPI/pokeapi-js-wrapper/blob/master/src/config.js#L3-L10)
69
+
Any option is optional :smile:. All the default values can be found [here](https://github.com/PokeAPI/pokeapi-js-wrapper/blob/master/src/config.js#L3-L11)
69
70
70
71
```js
71
72
constcustomOptions= {
@@ -95,6 +96,14 @@ It's fundamental that you download the Service Worker [we provide](https://raw.g
95
96
96
97
A [basic example](https://github.com/PokeAPI/pokeapi-js-wrapper/blob/master/test/example-sw.html) is hosted [here](https://pokeapi.github.io/pokeapi-js-wrapper/test/example-sw.html).
97
98
99
+
### Caching methods
100
+
101
+
```js
102
+
awaitP.getCacheLength() // Get how many objects are cached
103
+
awaitP.clearCache() // Remove all entries
104
+
awaitP.invalidateCache() // Remove only stale entries
105
+
```
106
+
98
107
## Tests
99
108
100
109
`pokeapi-js-wrapper` can be tested using two strategies. One is with Node, since this package works with Node, and the other with a browser.
@@ -103,7 +112,7 @@ A [basic example](https://github.com/PokeAPI/pokeapi-js-wrapper/blob/master/test
103
112
npm test
104
113
```
105
114
106
-
Or open `/test/test.html` in your browser. A live version can be found at[`gh-pages`](https://pokeapi.github.io/pokeapi-js-wrapper/test/test.html)
115
+
Or open `test/test.html` in your browser after serving the project with `npm run serve`. A live version can be found on the project[`gh-pages`](https://pokeapi.github.io/pokeapi-js-wrapper/test/test.html)
0 commit comments