Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anishmprasad/cache
https://github.com/anishmprasad/cache
Last synced: about 9 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/anishmprasad/cache
- Owner: anishmprasad
- Created: 2018-04-15T18:21:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-28T16:02:05.000Z (about 6 years ago)
- Last Synced: 2025-01-01T08:42:10.451Z (about 2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cache
usage cache
```js
import { sessionResponseCache } from 'cache';
sessionResponseCache
.fetchTypeaheadSearchResponse(search_query, cid_entry, idx_entry)
.then(cacheData => {
doOnSearchResult(dispatch, cacheData.response);
return cacheData.response;
})
.catch(err => {
return axios
.get(apiurl)
.then(response => {
sessionResponseCache.addTypeaheadSearchResponse(search_query, cid_entry, idx_entry, { response });
sessionResponseCache.addSearchResponse(search_query, goal_id, -1, 1, { response });
return response;
})
.catch(function(error) {
return error;
});
});
```