PhiloBiblon / philobiblon-ui

PhiloBiblon UI
Creative Commons Attribution Share Alike 4.0 International
0 stars 0 forks source link

Unify requests to wikibase with wbFetcher #8

Closed jmformenti closed 8 months ago

jmformenti commented 10 months ago

Currently we have requests to Wikibase in different places within the code, for example: https://github.com/PhiloBiblon/philobiblon-ui/blob/master/frontend/pages/wiki/_page.vue#L30 https://github.com/PhiloBiblon/philobiblon-ui/blob/master/frontend/service/wikibase.service.js#L46 https://github.com/PhiloBiblon/philobiblon-ui/blob/master/frontend/service/wikibase.service.js#L172

The idea is use wbFetcher method as standard way to implement these request:

  1. wbFetcher will receive a single input parameter: url
  2. The method will check the url in a cache, if exists, the cached response will be returned otherwise it will perform the request.