Download next.js/test/e2e/app-dir/app-static/cache-handler.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 436 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/cache-handler.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-static/cache-handler.js
-
curl -L -o cache-handler.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-static/cache-handler.js
436 Bytes
| const cache = new Map() | |
| module.exports = class CacheHandler { | |
| constructor(options) { | |
| this.options = options | |
| this.cache = {} | |
| console.log('initialized custom cache-handler') | |
| } | |
| async get(key) { | |
| console.log('cache-handler get', key) | |
| return cache.get(key) | |
| } | |
| async set(key, data) { | |
| console.log('cache-handler set', key) | |
| cache.set(key, { | |
| value: data, | |
| lastModified: Date.now(), | |
| }) | |
| } | |
| } | |