{"_id":"use-asset","_rev":"4029472","name":"use-asset","description":"A data fetching strategy for React Suspense","dist-tags":{"alpha":"2.0.0-alpha-00","latest":"1.0.4"},"maintainers":[{"name":"drcmda","email":""}],"time":{"modified":"2025-09-01T03:30:31.000Z","created":"2020-09-17T16:58:10.926Z","2.0.0-alpha-00":"2021-09-08T09:40:43.916Z","1.0.4":"2021-03-26T10:48:38.640Z","1.0.3":"2021-03-23T23:26:59.820Z","1.0.2":"2021-01-24T13:22:48.635Z","1.0.1":"2021-01-23T14:51:02.806Z","1.0.0":"2021-01-16T13:59:15.122Z","0.2.0":"2020-11-12T13:03:21.414Z","0.1.5":"2020-11-12T10:29:26.415Z","0.1.4":"2020-11-06T06:08:44.139Z","0.1.3":"2020-11-04T21:15:39.094Z","0.1.2":"2020-10-12T10:13:45.480Z","0.1.1":"2020-09-18T06:03:31.613Z","0.1.0":"2020-09-17T21:47:44.472Z","0.0.1":"2020-09-17T18:01:25.253Z","0.0.0":"2020-09-17T16:58:10.926Z"},"users":{},"author":{"name":"Paul Henschel"},"repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"versions":{"2.0.0-alpha-00":{"name":"use-asset","version":"2.0.0-alpha-00","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"devDependencies":{"@babel/core":"7.15.5","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-modules-commonjs":"7.15.4","@babel/plugin-transform-parameters":"7.15.4","@babel/plugin-transform-runtime":"7.15.0","@babel/plugin-transform-template-literals":"7.14.5","@babel/preset-env":"7.15.4","@babel/preset-react":"7.14.5","@babel/preset-typescript":"^7.15.0","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-node-resolve":"^13.0.4","@types/jest":"^27.0.1","@types/node":"^16.7.13","@types/react":"^17.0.20","@types/react-dom":"^17.0.9","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.31.0","@typescript-eslint/parser":"^4.31.0","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-import":"^2.24.2","eslint-plugin-jest":"^24.4.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-react":"^7.25.1","eslint-plugin-react-hooks":"^4.2.0","husky":"^7.0.2","lint-staged":"^11.1.2","prettier":"^2.3.2","react":"^0.0.0-experimental-031abd24b-20210907","rollup":"^2.56.3","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.4.2"},"peerDependencies":{"react":">=18.0"},"dependencies":{"fast-deep-equal":"^3.1.3"},"readmeFilename":"readme.md","gitHead":"8651d5be3f1e3aed1bbd1c9c5ca44efe0c788847","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@2.0.0-alpha-00","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"shasum":"8a9be97a035fb48dacc38fd2bd21c3b0e867c0c1","size":65684,"noattachment":false,"key":"/use-asset/-/use-asset-2.0.0-alpha-00.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-2.0.0-alpha-00.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_2.0.0-alpha-00_1631094043780_0.19979233013646458"},"_hasShrinkwrap":false,"publish_time":1631094043916,"_cnpm_publish_time":1631094043916,"_cnpmcore_publish_time":"2021-12-16T10:52:21.562Z"},"1.0.4":{"name":"use-asset","version":"1.0.4","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"devDependencies":{"@babel/core":"7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"7.12.1","@babel/plugin-transform-parameters":"7.12.1","@babel/plugin-transform-runtime":"7.12.10","@babel/plugin-transform-template-literals":"7.12.1","@babel/preset-env":"7.12.11","@babel/preset-react":"7.12.10","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/react-test-renderer":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","eslint":"^7.18.0","eslint-config-prettier":"^6.13.0","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-import":"^2.22.1","eslint-plugin-jest":"^24.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.3.8","lint-staged":"^10.5.3","prettier":"^2.2.1","react":"^17.0.1","rollup":"^2.36.2","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17.0"},"dependencies":{"fast-deep-equal":"^3.1.3"},"gitHead":"02ce76ee99aa0d42320a505ef4cff7a8a519ec8a","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@1.0.4","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"shasum":"506caafc29f602890593799e58b577b70293a6e2","size":65322,"noattachment":false,"key":"/use-asset/-/use-asset-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-1.0.4.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_1.0.4_1616755718458_0.8517136989658605"},"_hasShrinkwrap":false,"publish_time":1616755718640,"_cnpm_publish_time":1616755718640,"_cnpmcore_publish_time":"2021-12-16T10:52:22.042Z"},"1.0.3":{"name":"use-asset","version":"1.0.3","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"devDependencies":{"@babel/core":"7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"7.12.1","@babel/plugin-transform-parameters":"7.12.1","@babel/plugin-transform-runtime":"7.12.10","@babel/plugin-transform-template-literals":"7.12.1","@babel/preset-env":"7.12.11","@babel/preset-react":"7.12.10","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/react-test-renderer":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","eslint":"^7.18.0","eslint-config-prettier":"^6.13.0","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-import":"^2.22.1","eslint-plugin-jest":"^24.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.3.8","lint-staged":"^10.5.3","prettier":"^2.2.1","react":"^17.0.1","rollup":"^2.36.2","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17.0"},"dependencies":{"fast-deep-equal":"^3.1.3"},"gitHead":"e3f9feaa3269318075b00ab2b95239138e429e02","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@1.0.3","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"shasum":"b5d7a79621a7ad1742fe28e1248e89eef5b924c9","size":65303,"noattachment":false,"key":"/use-asset/-/use-asset-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-1.0.3.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_1.0.3_1616542019636_0.22484163196316698"},"_hasShrinkwrap":false,"publish_time":1616542019820,"_cnpm_publish_time":1616542019820,"_cnpmcore_publish_time":"2021-12-16T10:52:22.467Z"},"1.0.2":{"name":"use-asset","version":"1.0.2","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"devDependencies":{"@babel/core":"7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"7.12.1","@babel/plugin-transform-parameters":"7.12.1","@babel/plugin-transform-runtime":"7.12.10","@babel/plugin-transform-template-literals":"7.12.1","@babel/preset-env":"7.12.11","@babel/preset-react":"7.12.10","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/react-test-renderer":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","eslint":"^7.18.0","eslint-config-prettier":"^6.13.0","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-import":"^2.22.1","eslint-plugin-jest":"^24.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.3.8","lint-staged":"^10.5.3","prettier":"^2.2.1","react":"^17.0.1","rollup":"^2.36.2","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17.0"},"dependencies":{"fast-deep-equal":"^3.1.3"},"gitHead":"690441d1fbe3f1c6ad5976ec78c8ab8c8ca5744e","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@1.0.2","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"shasum":"d98a506ba480d113639de60631f89907794ead84","size":65364,"noattachment":false,"key":"/use-asset/-/use-asset-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-1.0.2.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_1.0.2_1611494568439_0.1573769809305341"},"_hasShrinkwrap":false,"publish_time":1611494568635,"_cnpm_publish_time":1611494568635,"_cnpmcore_publish_time":"2021-12-16T10:52:22.831Z"},"1.0.1":{"name":"use-asset","version":"1.0.1","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"devDependencies":{"@babel/core":"7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"7.12.1","@babel/plugin-transform-parameters":"7.12.1","@babel/plugin-transform-runtime":"7.12.10","@babel/plugin-transform-template-literals":"7.12.1","@babel/preset-env":"7.12.11","@babel/preset-react":"7.12.10","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/react-test-renderer":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","eslint":"^7.18.0","eslint-config-prettier":"^6.13.0","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-import":"^2.22.1","eslint-plugin-jest":"^24.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.3.8","lint-staged":"^10.5.3","prettier":"^2.2.1","react":"^17.0.1","rollup":"^2.36.2","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17.0"},"gitHead":"a9b1f40964335f1680fac5a4c5fa872d516aa634","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@1.0.1","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"shasum":"c41287ddcc472553a2abe63f26da6c64c2b81e33","size":65401,"noattachment":false,"key":"/use-asset/-/use-asset-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-1.0.1.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_1.0.1_1611413462629_0.6918227032376807"},"_hasShrinkwrap":false,"publish_time":1611413462806,"_cnpm_publish_time":1611413462806,"_cnpmcore_publish_time":"2021-12-16T10:52:23.270Z"},"1.0.0":{"name":"use-asset","version":"1.0.0","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"7.12.1","@babel/plugin-transform-parameters":"7.12.1","@babel/plugin-transform-runtime":"7.12.10","@babel/plugin-transform-template-literals":"7.12.1","@babel/preset-env":"7.12.11","@babel/preset-react":"7.12.10","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-node-resolve":"^11.1.0","@types/jest":"^26.0.20","@types/node":"^14.14.21","@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@types/react-test-renderer":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","husky":"^4.3.8","lint-staged":"^10.5.3","prettier":"^2.2.1","rollup":"^2.36.2","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17.0"},"gitHead":"d51fafbd8b3219b1a39c7caad644e699003b70bc","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@1.0.0","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"08dd22c1828e3ec03bfe1076b9fdc318f0817039","size":63909,"noattachment":false,"key":"/use-asset/-/use-asset-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-1.0.0.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_1.0.0_1610805554932_0.08522959894012705"},"_hasShrinkwrap":false,"publish_time":1610805555122,"_cnpm_publish_time":1610805555122,"_cnpmcore_publish_time":"2021-12-16T10:52:23.656Z"},"0.2.0":{"name":"use-asset","version":"0.2.0","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":">=16.13"},"gitHead":"700254b175b35d3b13f20d8eccd62c1c2b85e8be","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@0.2.0","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"e626f5d16e0ac5861f35d098fa224a6b3067049d","size":63905,"noattachment":false,"key":"/use-asset/-/use-asset-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.2.0.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.2.0_1605186201295_0.8605141711779218"},"_hasShrinkwrap":false,"publish_time":1605186201414,"_cnpm_publish_time":1605186201414,"_cnpmcore_publish_time":"2021-12-16T10:52:24.197Z"},"0.1.5":{"name":"use-asset","version":"0.1.5","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":">=16.13"},"gitHead":"c98030b8167c7992c3c87354b201cbe50e6443f7","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@0.1.5","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"196b6edf9f162bb900e0990888da3215514dec29","size":63754,"noattachment":false,"key":"/use-asset/-/use-asset-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.1.5.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.1.5_1605176966272_0.9558727832698284"},"_hasShrinkwrap":false,"publish_time":1605176966415,"_cnpm_publish_time":1605176966415,"_cnpmcore_publish_time":"2021-12-16T10:52:24.523Z"},"0.1.4":{"name":"use-asset","version":"0.1.4","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":">=16.13"},"gitHead":"536f9e2f1418406511d6432389ad27c346c6da6d","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@0.1.4","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"f5cd4fda9f3d91268dd6b2c26d38d0ad159b6a1d","size":63750,"noattachment":false,"key":"/use-asset/-/use-asset-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.1.4.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.1.4_1604642923919_0.8681721338258614"},"_hasShrinkwrap":false,"publish_time":1604642924139,"_cnpm_publish_time":1604642924139,"_cnpmcore_publish_time":"2021-12-16T10:52:24.928Z"},"0.1.3":{"name":"use-asset","version":"0.1.3","description":"A data fetching strategy for React Suspense","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmndrs/use-asset.git"},"homepage":"https://github.com/pmndrs/use-asset#readme","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":">=16.13"},"gitHead":"0904d50d6e5f8b3079d019160fe49c5fd098d59a","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"_id":"use-asset@0.1.3","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"c38ab8cf2cc5d093b7a0c625fc3986d4a44dde15","size":63655,"noattachment":false,"key":"/use-asset/-/use-asset-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.1.3.tgz"},"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"maintainers":[{"name":"drcmda","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.1.3_1604524538904_0.7658355695589756"},"_hasShrinkwrap":false,"publish_time":1604524539094,"_cnpm_publish_time":1604524539094,"_cnpmcore_publish_time":"2021-12-16T10:52:25.401Z"},"0.1.2":{"name":"use-asset","version":"0.1.2","description":"<p align=\"left\">   <a id=\"cover\" href=\"#cover\"><img src=\"img/cover.svg\" alt=\"This library allows you to create cached assets, which can be promises, async functions or even dynamic imports. These assets then have the ability to suspend the component in wh","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":"^16.13.1","react-three-fiber":"^4.2.20","three":"^0.119.1"},"gitHead":"2965dd2e20b900223fbeb68525eb9746a6e05133","_id":"use-asset@0.1.2","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"ec32e6f212d772e1e4873991d7a6ec326a7a44eb","size":63487,"noattachment":false,"key":"/use-asset/-/use-asset-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.1.2.tgz"},"maintainers":[{"name":"drcmda","email":""}],"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.1.2_1602497625262_0.5364200923678604"},"_hasShrinkwrap":false,"publish_time":1602497625480,"_cnpm_publish_time":1602497625480,"_cnpmcore_publish_time":"2021-12-16T10:52:26.653Z"},"0.1.1":{"name":"use-asset","version":"0.1.1","description":"<p align=\"left\">   <a id=\"cover\" href=\"#cover\"><img src=\"img/cover.svg\" alt=\"This library allows you to create cached assets, which can be promises, async functions or even dynamic imports. These assets then have the ability to suspend the component in wh","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":"^16.13.1","react-three-fiber":"^4.2.20","three":"^0.119.1"},"gitHead":"872d23f0841bbeb0b92bde95c112a97502e658cb","_id":"use-asset@0.1.1","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"cc6835c36ee1b9cc79708d4c8fa954a62d55bc1c","size":54190,"noattachment":false,"key":"/use-asset/-/use-asset-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.1.1.tgz"},"maintainers":[{"name":"drcmda","email":""}],"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.1.1_1600409011451_0.2091626722358142"},"_hasShrinkwrap":false,"publish_time":1600409011613,"_cnpm_publish_time":1600409011613,"_cnpmcore_publish_time":"2021-12-16T10:52:27.079Z"},"0.1.0":{"name":"use-asset","version":"0.1.0","description":"A simple loading strategy for React Suspense based on [react-promise-suspense](https://github.com/vigzmv/react-promise-suspense).","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":"^16.13.1","react-three-fiber":"^4.2.20","three":"^0.119.1"},"gitHead":"86fb285fd29f955dda73ab475a0eb72e1854697a","_id":"use-asset@0.1.0","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"7e1e6b1fa677c4a6906747264508e7b6675d8b5b","size":5109,"noattachment":false,"key":"/use-asset/-/use-asset-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.1.0.tgz"},"maintainers":[{"name":"drcmda","email":""}],"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.1.0_1600379264318_0.4700878357520324"},"_hasShrinkwrap":false,"publish_time":1600379264472,"_cnpm_publish_time":1600379264472,"_cnpmcore_publish_time":"2021-12-16T10:52:27.336Z"},"0.0.1":{"name":"use-asset","version":"0.0.1","description":"A simple loading strategy for react suspense based on [react-promise-suspense](https://github.com/vigzmv/react-promise-suspense).","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix"]},"scripts":{"build":"rollup -c","postbuild":"tsc --emitDeclarationOnly","prepublishOnly":"npm run build","test":"echo no tests yet"},"dependencies":{"fast-deep-equal":"^3.1.3"},"devDependencies":{"@babel/core":"7.11.0","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"7.10.4","@babel/plugin-transform-parameters":"7.10.5","@babel/plugin-transform-runtime":"7.11.0","@babel/plugin-transform-template-literals":"7.10.5","@babel/preset-env":"7.11.0","@babel/preset-react":"7.10.4","@babel/preset-typescript":"^7.10.4","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.8","@types/node":"^14.6.0","@types/react":"^16.9.46","@types/react-dom":"^16.9.8","@types/react-test-renderer":"^16.9.3","@typescript-eslint/eslint-plugin":"^3.7.1","@typescript-eslint/parser":"^3.7.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^2.0.5","rollup":"^2.26.10","rollup-plugin-size-snapshot":"^0.12.0","rollup-plugin-terser":"^7.0.2","typescript":"^3.9.7"},"peerDependencies":{"react":"^16.13.1","react-three-fiber":"^4.2.20","three":"^0.119.1"},"gitHead":"26fd358ca44960571049f25134482bc99b1b04d9","_id":"use-asset@0.0.1","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"408ef2089707d4665754bb13f16d22d7ba49b4c8","size":5107,"noattachment":false,"key":"/use-asset/-/use-asset-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.0.1.tgz"},"maintainers":[{"name":"drcmda","email":""}],"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.0.1_1600365685140_0.5632521135140589"},"_hasShrinkwrap":false,"publish_time":1600365685253,"_cnpm_publish_time":1600365685253,"_cnpmcore_publish_time":"2021-12-16T10:52:27.544Z"},"0.0.0":{"name":"use-asset","version":"0.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["react","suspense","resource","asset"],"author":{"name":"Paul Henschel"},"license":"MIT","_id":"use-asset@0.0.0","_nodeVersion":"14.7.0","_npmVersion":"6.14.7","dist":{"shasum":"b03d4be5d8d048342ca5f258ec5d374cf3c821aa","size":286,"noattachment":false,"key":"/use-asset/-/use-asset-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-asset/download/use-asset-0.0.0.tgz"},"maintainers":[{"name":"drcmda","email":""}],"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-asset_0.0.0_1600361890735_0.3235741481340688"},"_hasShrinkwrap":false,"publish_time":1600361890926,"_cnpm_publish_time":1600361890926,"_cnpmcore_publish_time":"2021-12-16T10:52:27.765Z"}},"readme":"<p align=\"left\">\n  <a id=\"cover\" href=\"#cover\"><img src=\"img/cover.svg\" alt=\"This library allows you to create cached assets, which can be promises, async functions or even dynamic imports. These assets then have the ability to suspend the component in which they are read. This makes it easier to orchestrate async tasks and gives you the ability to set up fallbacks and error-handling declaratively.\" /></a>\n</p>\n\n[![Build Size](https://img.shields.io/bundlephobia/min/use-asset?label=bunlde%20size&style=flat&colorA=000000&colorB=000000)](https://bundlephobia.com/result?p=use-asset)\n[![Build Status](https://img.shields.io/travis/pmndrs/use-asset/master?style=flat&colorA=000000&colorB=000000)](https://travis-ci.org/pmndrs/use-asset)\n[![Version](https://img.shields.io/npm/v/use-asset?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/use-asset)\n[![Downloads](https://img.shields.io/npm/dt/use-asset.svg?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/use-asset)\n\n<p align=\"left\">\n  <a id=\"async-assets\" href=\"#async-assets\"><img src=\"img/async-assets.svg\" alt=\"Dealing with async assets\" /></a>\n</p>\n\n<p align=\"left\">\n  <a id=\"using-assets\" href=\"#using-assets\"><img src=\"img/createAsset.svg\" alt=\"Types\" /></a>\n</p>\n\nEach asset you create comes with its own cache. When you request something from it, the arguments that you pass will act as cache-keys. If you request later on using the same keys, it won't have to re-fetch but serves the result that it already knows.\n\n```jsx\nimport React, { Suspense } from \"react\"\nimport { createAsset } from \"use-asset\"\n\nconst asset = createAsset(async (id, version) => {\n  const res = await fetch(`https://hacker-news.firebaseio.com/${version}/item/${id}.json`)\n  return await res.json()\n})\n\nfunction Post({ id }) {\n  const { by, title } = asset.read(id, \"v0\")\n  return <div>{title} by {by}</div>\n}\n\nfunction App() {\n  <Suspense fallback={null}>\n    <Post id={10000} />\n  </Suspense>\n}\n```\n\n#### Preloading assets\n\n```jsx\n// You can preload assets, these will be executed and cached immediately\nasset.preload(\"/image.png\")\n```\n\n#### Cache busting strategies\n\n```jsx\n// This asset will be removed from the cache in 15 seconds\nconst asset = createAsset(promiseFn, 15000)\n// Clear all cached entries\nasset.clear()\n// Clear a specific entry\nasset.clear(\"/image.png\")\n```\n\n#### Peeking into entries outside of suspense\n\n```jsx\n// This will either return the value (without suspense!) or undefined\nasset.peek(\"/image.png\")\n```\n\n<p align=\"left\">\n  <a id=\"hooks-global-cache\" href=\"#hooks-global-cache\"><img src=\"img/hooks-global-cache.svg\" alt=\"Hooks and global cache\" /></a>\n</p>\n\n<p align=\"left\">\n  <a id=\"cover\" href=\"#hooks-and-global-cache\"><img src=\"img/useAsset.svg\" alt=\"Types\" /></a>\n</p>\n\nYou can also use the `useAsset` hook, which is modelled after [react-promise-suspense](https://github.com/vigzmv/react-promise-suspense). This makes it possible to define assets on the spot instead of having to define them externally. They use a global cache, anything you request at any time is written into it.\n\n```jsx\nimport { useAsset } from \"use-asset\"\n\nfunction Post({ id }) {\n  const { by, title } = useAsset(fn, id)\n  return <div>{title} by {by}</div>\n}\n\nfunction App() {\n  <Suspense fallback={null}>\n    <Post id={1000} />\n```\n\n#### Cache busting, preload and peeking\n\nThe hook has the same API as any asset:\n\n```jsx\n// Bust cache in 15 seconds\nuseAsset.lifespan = 15000\nuseAsset(promiseFn, \"/image.png\")\n// Clear all cached entries\nuseAsset.clear()\n// Clear a specific entry\nuseAsset.clear(\"/image.png\")\n// Preload entries\nuseAsset.preload(promiseFn, \"/image.png\")\n// This will either return the value (without suspense!) or undefined\nuseAsset.peek(\"/image.png\")\n```\n\n<p align=\"left\">\n  <a id=\"recipes\" href=\"#recipes\"><img src=\"img/recipes.svg\" alt=\"Recipes\" /></a>\n</p>\n\n#### Simple data fetching\n\nFetching posts from hacker-news: [codesandbox](https://codesandbox.io/s/use-asset-demo-forked-ji8ky)\n\n#### Infinite load on scroll\n\nFetching HN posts infinitely: [codesandbox](https://codesandbox.io/s/use-asset-forked-ouzkc)\n\n#### Async dependencies\n\nComponent A waits for the result of component B: [codesandbox](https://codesandbox.io/s/use-asset-dependency-70908)\n","_attachments":{},"homepage":"https://github.com/pmndrs/use-asset#readme","bugs":{"url":"https://github.com/pmndrs/use-asset/issues"},"license":"MIT"}