{"_id":"use-callback-ref","_rev":"3867912","name":"use-callback-ref","description":"The same useRef, but with callback","dist-tags":{"latest":"1.3.3"},"maintainers":[{"name":"kashey","email":""}],"time":{"modified":"2025-09-01T00:53:18.000Z","created":"2019-06-21T09:34:06.376Z","1.3.3":"2024-12-17T11:07:58.012Z","1.3.2":"2024-03-20T11:10:51.031Z","1.3.1":"2023-12-26T05:10:10.398Z","1.3.0":"2022-04-18T02:22:06.557Z","1.2.5":"2021-01-17T01:44:29.890Z","1.2.4":"2020-06-06T11:13:51.017Z","1.2.3":"2020-04-16T08:07:51.835Z","1.2.2":"2020-04-11T01:05:27.306Z","1.2.1":"2019-10-12T09:42:39.871Z","1.2.0":"2019-10-12T07:16:16.101Z","1.1.0":"2019-10-08T22:45:07.478Z","1.0.1":"2019-06-22T03:02:46.652Z","1.0.0":"2019-06-21T09:34:06.376Z"},"users":{},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"versions":{"1.3.3":{"name":"use-callback-ref","version":"1.3.3","description":"The same useRef, but with callback","main":"dist/es5/index.js","jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","module:es2019":"dist/es2019/index.js","sideEffects":false,"scripts":{"dev":"lib-builder dev","test":"jest","test:ci":"jest --runInBand --coverage","build":"lib-builder build && yarn size:report","release":"yarn build && yarn test","size":"npx size-limit","size:report":"npx size-limit --json > .size.json","lint":"lib-builder lint","format":"lib-builder format","update":"lib-builder update","prepublish":"yarn build && yarn changelog","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s","changelog:rewrite":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{"tslib":"^2.0.0"},"devDependencies":{"@size-limit/preset-small-lib":"^11.0.2","size-limit":"^11.0.2","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^14.1.2","@theuiteam/lib-builder":"^0.3.0","jest-environment-jsdom":"^29.7.0"},"peerDependencies":{"@types/react":"*","react":"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=10"},"keywords":["react","hook","useRef","createRef","merge refs"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["prettier --write","eslint --fix","git add"],"*.{js,css,json,md}":["prettier --write","git add"]},"prettier":{"printWidth":120,"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true},"_id":"use-callback-ref@1.3.3","gitHead":"bd99fd56601f693ecdda88e2d4455cfa03c5689d","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_nodeVersion":"20.15.1","_npmVersion":"10.7.0","dist":{"shasum":"98d9fab067075841c5b2c6852090d5d0feabe2bf","size":9288,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.3.3.tgz"},"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"kashey","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/use-callback-ref_1.3.3_1734433677861_0.29755982493538014"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-17T11:07:58.012Z","publish_time":1734433678012,"_source_registry_name":"default","_cnpm_publish_time":1734433678012},"1.3.2":{"name":"use-callback-ref","version":"1.3.2","description":"The same useRef, but with callback","main":"dist/es5/index.js","jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","module:es2019":"dist/es2019/index.js","sideEffects":false,"scripts":{"dev":"lib-builder dev","test":"jest","test:ci":"jest --runInBand --coverage","build":"lib-builder build && yarn size:report","release":"yarn build && yarn test","size":"npx size-limit","size:report":"npx size-limit --json > .size.json","lint":"lib-builder lint","format":"lib-builder format","update":"lib-builder update","prepublish":"yarn build && yarn changelog","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s","changelog:rewrite":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{"tslib":"^2.0.0"},"devDependencies":{"@size-limit/preset-small-lib":"^2.1.6","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^14.1.2","@theuiteam/lib-builder":"^0.3.0","jest-environment-jsdom":"^29.7.0"},"peerDependencies":{"@types/react":"^16.8.0 || ^17.0.0 || ^18.0.0","react":"^16.8.0 || ^17.0.0 || ^18.0.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=10"},"keywords":["react","hook","useRef","createRef","merge refs"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["prettier --write","eslint --fix","git add"],"*.{js,css,json,md}":["prettier --write","git add"]},"prettier":{"printWidth":120,"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true},"_id":"use-callback-ref@1.3.2","gitHead":"df9da0fedf6eb89f454b32a986049a511e504a1d","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"shasum":"6134c7f6ff76e2be0b56c809b17a650c942b1693","size":9279,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.3.2.tgz"},"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"kashey","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.3.2_1710933050881_0.41499424605078317"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-20T11:10:51.031Z","publish_time":1710933051031,"_source_registry_name":"default","_cnpm_publish_time":1710933051031},"1.3.1":{"name":"use-callback-ref","version":"1.3.1","description":"The same useRef, but with callback","main":"dist/es5/index.js","jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","module:es2019":"dist/es2019/index.js","sideEffects":false,"scripts":{"dev":"lib-builder dev","test":"jest","test:ci":"jest --runInBand --coverage","build":"lib-builder build && yarn size:report","release":"yarn build && yarn test","size":"npx size-limit","size:report":"npx size-limit --json > .size.json","lint":"lib-builder lint","format":"lib-builder format","update":"lib-builder update","prepublish":"yarn build && yarn changelog","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s","changelog:rewrite":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{"tslib":"^2.0.0"},"devDependencies":{"@size-limit/preset-small-lib":"^2.1.6","@testing-library/jest-dom":"^6.1.5","@testing-library/react":"^14.1.2","@theuiteam/lib-builder":"^0.3.0","jest-environment-jsdom":"^29.7.0"},"peerDependencies":{"@types/react":"^16.8.0 || ^17.0.0 || ^18.0.0","react":"^16.8.0 || ^17.0.0 || ^18.0.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=10"},"keywords":["react","hook","useRef","createRef","merge refs"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["prettier --write","eslint --fix","git add"],"*.{js,css,json,md}":["prettier --write","git add"]},"prettier":{"printWidth":120,"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true},"gitHead":"365ee2b67c32eee84ce2b5c2bb68ea569f84b3cd","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_id":"use-callback-ref@1.3.1","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"shasum":"9be64c3902cbd72b07fe55e56408ae3a26036fd0","size":9259,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.3.1.tgz"},"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"kashey","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.3.1_1703567410151_0.32834838769496777"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-26T05:10:10.398Z","publish_time":1703567410398,"_source_registry_name":"default","_cnpm_publish_time":1703567410398},"1.3.0":{"name":"use-callback-ref","version":"1.3.0","description":"The same useRef, but with callback","main":"dist/es5/index.js","jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","module:es2019":"dist/es2019/index.js","sideEffects":false,"scripts":{"dev":"lib-builder dev","test":"jest","test:ci":"jest --runInBand --coverage","build":"lib-builder build && yarn size:report","release":"yarn build && yarn test","size":"npx size-limit","size:report":"npx size-limit --json > .size.json","lint":"lib-builder lint","format":"lib-builder format","update":"lib-builder update","prepublish":"yarn build && yarn changelog","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s","changelog:rewrite":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{"tslib":"^2.0.0"},"devDependencies":{"@theuiteam/lib-builder":"^0.1.4","@size-limit/preset-small-lib":"^2.1.6","@types/enzyme-adapter-react-16":"^1.0.6","enzyme-adapter-react-16":"^1.15.6"},"peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0","@types/react":"^16.8.0 || ^17.0.0 || ^18.0.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=10"},"keywords":["react","hoot","useRef","createRef"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["prettier --write","eslint --fix","git add"],"*.{js,css,json,md}":["prettier --write","git add"]},"prettier":{"printWidth":120,"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true},"gitHead":"43dd323f1820604e36883b8342ec7db9a7c27765","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_id":"use-callback-ref@1.3.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"shasum":"772199899b9c9a50526fedc4993fc7fa1f7e32d5","size":8808,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.3.0.tgz"},"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"kashey","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.3.0_1650248526346_0.32599727441495774"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-18T02:22:11.113Z","publish_time":1650248526557,"_cnpm_publish_time":1650248526557},"1.2.5":{"name":"use-callback-ref","version":"1.2.5","description":"The same useRef, but with callback","main":"dist/es5/index.js","sideEffects":false,"scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{},"devDependencies":{"ts-react-toolbox":"^0.2.11"},"peerDependencies":{"react":"^16.8.0 || ^17.0.0","@types/react":"^16.8.0 || ^17.0.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=8.5.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.4 KB"},{"path":"dist/es2015/useRef.js","limit":"0.2 KB"},{"path":"dist/es2015/useMergeRef.js","limit":"0.2 KB"}],"gitHead":"4df158d172c421ca27e39a610303e333ba689060","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_id":"use-callback-ref@1.2.5","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"shasum":"6115ed242cfbaed5915499c0a9842ca2912f38a5","size":7177,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.2.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.2.5.tgz"},"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"kashey","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.2.5_1610847869777_0.17275788629188793"},"_hasShrinkwrap":false,"publish_time":1610847869890,"_cnpm_publish_time":1610847869890},"1.2.4":{"name":"use-callback-ref","version":"1.2.4","description":"The same useRef, but with callback","main":"dist/es5/index.js","sideEffects":false,"scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{},"devDependencies":{"ts-react-toolbox":"^0.2.11"},"peerDependencies":{"react":"^16.8.0","@types/react":"^16.8.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=8.5.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.4 KB"},{"path":"dist/es2015/useRef.js","limit":"0.2 KB"},{"path":"dist/es2015/useMergeRef.js","limit":"0.2 KB"}],"gitHead":"44a44c434a210e9efc6465265a1cf1b119b03a73","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_id":"use-callback-ref@1.2.4","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"d86d1577bfd0b955b6e04aaf5971025f406bea3c","size":6959,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.2.4.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.2.4_1591442030788_0.7623288293187651"},"_hasShrinkwrap":false,"publish_time":1591442031017,"_cnpm_publish_time":1591442031017},"1.2.3":{"name":"use-callback-ref","version":"1.2.3","description":"The same useRef, but with callback","main":"dist/es5/index.js","sideEffects":false,"scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/use-callback-ref.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","dependencies":{},"devDependencies":{"ts-react-toolbox":"^0.2.11"},"peerDependencies":{"react":"^16.8.0","@types/react":"^16.8.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"engines":{"node":">=8.5.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.4 KB"},{"path":"dist/es2015/useRef.js","limit":"0.2 KB"},{"path":"dist/es2015/useMergeRef.js","limit":"0.2 KB"}],"gitHead":"35a09fb15372e34137f33eaa15ec26f0f361bccf","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"homepage":"https://github.com/theKashey/use-callback-ref#readme","_id":"use-callback-ref@1.2.3","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"shasum":"9f939dfb5740807bbf9dd79cdd4e99d27e827756","size":5443,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.2.3.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.2.3_1587024471674_0.09829212242662311"},"_hasShrinkwrap":false,"publish_time":1587024471835,"_cnpm_publish_time":1587024471835},"1.2.2":{"name":"use-callback-ref","version":"1.2.2","description":"The same useRef, but with callback","main":"dist/es5/index.js","sideEffects":false,"scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/kashe.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"ts-react-toolbox":"^0.2.2"},"engines":{"node":">=8.5.0"},"peerDependencies":{"react":"^16.8.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.4 KB"},{"path":"dist/es2015/useRef.js","limit":"0.2 KB"},{"path":"dist/es2015/useMergeRef.js","limit":"0.2 KB"}],"dependencies":{"@types/react":"^16.9.11"},"gitHead":"783b487062bc7fc1fa8766464a08956133e7e86a","bugs":{"url":"https://github.com/theKashey/kashe/issues"},"homepage":"https://github.com/theKashey/kashe#readme","_id":"use-callback-ref@1.2.2","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"shasum":"43f6270a2979915d0b0c715581859026c68ad5f8","size":5268,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.2.2.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.2.2_1586567127162_0.9390573120272478"},"_hasShrinkwrap":false,"publish_time":1586567127306,"_cnpm_publish_time":1586567127306},"1.2.1":{"name":"use-callback-ref","version":"1.2.1","description":"The same useRef, but with callback","main":"dist/es5/index.js","sideEffects":false,"scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/kashe.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"ts-react-toolbox":"^0.2.2"},"engines":{"node":">=8.5.0"},"peerDependencies":{"react":"^16.8.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.5 KB"},{"path":"dist/es2015/useRef.js","limit":"0.5 KB"}],"gitHead":"708bd0a0b4d85609d517689f4698971a41f41dd2","bugs":{"url":"https://github.com/theKashey/kashe/issues"},"homepage":"https://github.com/theKashey/kashe#readme","_id":"use-callback-ref@1.2.1","_nodeVersion":"10.15.3","_npmVersion":"6.10.2","dist":{"shasum":"898759ccb9e14be6c7a860abafa3ffbd826c89bb","size":5207,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.2.1.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.2.1_1570873359740_0.4097251837218563"},"_hasShrinkwrap":false,"publish_time":1570873359871,"_cnpm_publish_time":1570873359871},"1.2.0":{"name":"use-callback-ref","version":"1.2.0","description":"The same useRef, but with callback","main":"dist/es5/index.js","scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/kashe.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"ts-react-toolbox":"^0.2.2"},"engines":{"node":">=8.5.0"},"peerDependencies":{"react":"^16.8.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.5 KB"},{"path":"dist/es2015/useRef.js","limit":"0.5 KB"}],"gitHead":"88632357cea101370ba0ccb3f1ea45f02c12b886","bugs":{"url":"https://github.com/theKashey/kashe/issues"},"homepage":"https://github.com/theKashey/kashe#readme","_id":"use-callback-ref@1.2.0","_nodeVersion":"10.15.3","_npmVersion":"6.10.2","dist":{"shasum":"e085a60851a9b5395fba9c7292507814643aa4f7","size":5193,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.2.0.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.2.0_1570864575940_0.5364888424628591"},"_hasShrinkwrap":false,"publish_time":1570864576101,"_cnpm_publish_time":1570864576101},"1.1.0":{"name":"use-callback-ref","version":"1.1.0","description":"The same useRef, but with callback","main":"dist/es5/index.js","scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/kashe.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"ts-react-toolbox":"^0.2.2"},"engines":{"node":">=8.5.0"},"peerDependencies":{"react":"^16.8.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"size-limit":[{"path":"dist/es2015/index.js","limit":"0.5 KB"},{"path":"dist/es2015/useRef.js","limit":"0.5 KB"}],"gitHead":"13f9dacba9a91ac8d2d97078acac8db75a1a42d6","bugs":{"url":"https://github.com/theKashey/kashe/issues"},"homepage":"https://github.com/theKashey/kashe#readme","_id":"use-callback-ref@1.1.0","_nodeVersion":"10.15.3","_npmVersion":"6.10.2","dist":{"shasum":"e41d2b29aea8a568a6dbefe0af56155eac1b6884","size":3090,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.1.0.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.1.0_1570574707367_0.9166662919589308"},"_hasShrinkwrap":false,"publish_time":1570574707478,"_cnpm_publish_time":1570574707478},"1.0.1":{"name":"use-callback-ref","version":"1.0.1","description":"The same useRef, but with callback","main":"dist/es5/index.js","scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","prepublish":"yarn build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/kashe.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"ts-react-toolbox":"^0.2.2"},"engines":{"node":">=8.5.0"},"peerDependencies":{"react":"^16.8.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"gitHead":"0f87879169732e5f31c6a28d40a2895e02be925b","bugs":{"url":"https://github.com/theKashey/kashe/issues"},"homepage":"https://github.com/theKashey/kashe#readme","_id":"use-callback-ref@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"dist":{"shasum":"0e26f210efea3c3b14a6bfb3a8ef2475519171fa","size":2288,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.0.1.tgz"},"maintainers":[{"name":"kashey","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.0.1_1561172566493_0.5128779479562406"},"_hasShrinkwrap":false,"publish_time":1561172566652,"_cnpm_publish_time":1561172566652},"1.0.0":{"name":"use-callback-ref","version":"1.0.0","description":"The same useRef, but with callback","main":"dist/es5/index.js","scripts":{"test":"ts-react-toolbox test","bootstrap":"ts-react-toolbox init","dev":"ts-react-toolbox dev","test:ci":"ts-react-toolbox test --runInBand --coverage","build":"ts-react-toolbox build","release":"ts-react-toolbox release","lint":"ts-react-toolbox lint","static":"ts-react-toolbox publish","format":"ts-react-toolbox format","analyze":"ts-react-toolbox analyze"},"repository":{"type":"git","url":"git+https://github.com/theKashey/kashe.git"},"author":{"name":"theKashey","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"ts-react-toolbox":"^0.2.2"},"engines":{"node":">=8.5.0"},"peerDependencies":{"react":"^16.8.0"},"jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","keywords":["react","hoot","useRef","createRef"],"gitHead":"56b1b452d09b115183ece7d99db1ed04547c2261","bugs":{"url":"https://github.com/theKashey/kashe/issues"},"homepage":"https://github.com/theKashey/kashe#readme","_id":"use-callback-ref@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"dist":{"shasum":"fd63707b5455cc92b3dc416e2ed6ed7a861992c7","size":1954,"noattachment":false,"key":"/use-callback-ref/-/use-callback-ref-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/use-callback-ref/download/use-callback-ref-1.0.0.tgz"},"maintainers":[{"name":"kashey","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-callback-ref_1.0.0_1561109646096_0.5228201644096"},"_hasShrinkwrap":false,"publish_time":1561109646376,"_cnpm_publish_time":1561109646376}},"readme":"<div align=\"center\">\n  <h1>???? use-callback-ref ????</h1>\n  <br/>\n  The same `useRef` but it will callback: ???? Hello! Your ref was changed!\n  <br/>\n    <a href=\"https://www.npmjs.com/package/use-callback-ref\">\n      <img src=\"https://img.shields.io/npm/v/use-callback-ref.svg?style=flat-square\" />\n    </a>\n    <a href=\"https://travis-ci.org/theKashey/use-callback-ref\">\n       <img alt=\"Travis\" src=\"https://img.shields.io/travis/theKashey/use-callback-ref/master.svg?style=flat-square\">\n    </a>\n    <a href=\"https://bundlephobia.com/result?p=use-callback-ref\">\n      <img src=\"https://img.shields.io/bundlephobia/minzip/use-callback-ref.svg\" alt=\"bundle size\">\n    </a> \n</div>\n\n---\n\n> Keep in mind that useRef doesn't notify you when its content changes.\n> Mutating the .current property doesn't cause a re-render.\n> If you want to run some code when React attaches or detaches a ref to a DOM node,\n> you may want to use ~~a callback ref instead~~ .... **useCallbackRef** instead.\n\n– [Hooks API Reference](https://reactjs.org/docs/hooks-reference.html#useref)\n\nRead more about `use-callback` pattern and use cases:\n\n- https://dev.to/thekashey/the-same-useref-but-it-will-callback-8bo\n\nThis library exposes helpers to handle any case related to `ref` _lifecycle_\n\n- `useCallbackRef` - react on a ref change (replacement for `useRef`)\n  - `createCallbackRef` - - low level version of `useCallbackRef`\n- `useMergeRefs` - merge multiple refs together creating a stable return ref\n  - `mergeRefs` - low level version of `useMergeRefs`\n- `useTransformRef` - transform one ref to another (replacement for `useImperativeHandle`)\n  - `transformRef` - low level version of `useTransformRef`\n- `useRefToCallback` - convert RefObject to an old callback-style ref\n  - `refToCallback` - low level version of `useRefToCallback`\n- `assignRef` - assign value to the ref, regardless it is RefCallback or RefObject\n\nAll functions are tree shakable, but even together it's **less then 300b**.\n\n# API\n\n???? Some commands are hooks based, and returns the same refs/functions every render.\nBut some are not, to be used in classes or non-react code.\n\n## useRef API\n\n???? Use case: every time you have to react to ref change\n\nAPI is 99% compatible with React `createRef` and `useRef`, and just adds another argument - `callback`,\nwhich would be called on **ref update**.\n\n#### createCallbackRef - to replace React.createRef\n\n- `createCallbackRef(callback)` - would call provided `callback` when ref is changed.\n\n#### useCallbackRef - to replace React.useRef\n\n- `useCallbackRef(initialValue, callback)` - would call provided `callback` when ref is changed.\n\n> `callback` in both cases is `callback(newValue, oldValue)`. Callback would not be called if newValue and oldValue is the same.\n\n```js\nimport { useRef, createRef, useState } from 'react';\nimport { useCallbackRef, createCallbackRef } from 'use-callback-ref';\n\nconst Component = () => {\n  const [, forceUpdate] = useState();\n  // I dont need callback when ref changes\n  const ref = useRef(null);\n\n  // but sometimes - it could be what you need\n  const anotherRef = useCallbackRef(null, () => forceUpdate());\n\n  useEffect(() => {\n    // now it's just possible\n  }, [anotherRef.current]); // react to dom node change\n};\n```\n\n???? You can use `useCallbackRef` to convert RefObject into RefCallback, creating bridges between the old and the new code\n\n```js\n// some old component\nconst onRefUpdate = (newRef) => {...}\nconst refObject = useCallbackRef(null, onRefUpdate);\n// ...\n<SomeNewComponent ref={refObject}/>\n```\n\n## assignRef\n\n???? Use case: every time you need to assign ref manually, and you dont know the shape of the ref\n\n`assignRef(ref, value)` - assigns `values` to the `ref`. `ref` could be RefObject or RefCallback.\n\n```\n???? ref.current = value // what if it's a callback-ref?\n???? ref(value) // but what if it's a object ref?\n\nimport {assignRef} from \"use-callback-ref\";\n✅ assignRef(ref, value);\n```\n\n## useTransformRef (to replace React.useImperativeHandle)\n\n???? Use case: ref could be different.\n`transformRef(ref, tranformer):Ref` - return a new `ref` which would propagate all changes to the provided `ref` with applied `transform`\n\n```js\n// before\nconst ResizableWithRef = forwardRef((props, ref) => <Resizable {...props} ref={(i) => i && ref(i.resizable)} />);\n\n// after\n\nconst ResizableWithRef = forwardRef((props, ref) => (\n  <Resizable {...props} ref={transformRef(ref, (i) => (i ? i.resizable : null))} />\n));\n```\n\n## refToCallback\n\n`refToCallback(ref: RefObject): RefCallback` - for compatibility between the old and the new code.\nFor the compatibility between `RefCallback` and RefObject use `useCallbackRef(undefined, callback)`\n\n## useMergeRefs\n\n`mergeRefs(refs: arrayOfRefs, [defaultValue]):ReactMutableRef` - merges a few refs together\n\nWhen developing low level UI components, it is common to have to use a local ref but also support an external one using React.forwardRef. Natively, React does not offer a way to set two refs inside the ref property. This is the goal of this small utility.\n\n```js\nimport React from 'react';\nimport { useMergeRefs } from 'use-callback-ref';\n\nconst MergedComponent = React.forwardRef((props, ref) => {\n  const localRef = React.useRef();\n  // ...\n  // both localRef and ref would be populated with the `ref` to a `div`\n  return <div ref={useMergeRefs([localRef, ref])} />;\n});\n```\n\n???? - `useMergeRefs` will always give you the same return, and you don't have to worry about `[localRef, ref]` unique every render.\n\n## mergeRefs\n\n`mergeRefs(refs: arrayOfRefs, [defaultValue]):ReactMutableRef` - merges a few refs together\nis a non-hook based version. Will produce the new `ref` every run, causing the old one to unmount, and be _populated_ with the `null` value.\n\n> mergeRefs are based on https://github.com/smooth-code/react-merge-refs, just exposes a RefObject, instead of a callback\n\n`mergeRefs` are \"safe\" to use as a part of other hooks-based commands, but don't forget - it returns a new object every call.\n\n# Similar packages:\n\n- [apply-ref](https://github.com/mitchellhamilton/apply-ref) - `applyRefs` is simular to `mergeRef`, `applyRef` is similar to `assignRef`\n- [useForkRef](https://react-hooks.org/docs/use-fork-ref) - `useForkRef` is simular to `useMergeRefs`, but accepts only two arguments.\n- [react-merge-refs](https://github.com/gregberge/react-merge-refs) - `merge-refs` is simular to `useMergeRefs`, but not a hook and does not provide \"stable\" reference.\n\n---\n\n> Is it a rocket science? No, `RefObject` is no more than `{current: ref}`, and `use-callback-ref` is no more than `getter` and `setter` on that field.\n\n# License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/theKashey/use-callback-ref#readme","bugs":{"url":"https://github.com/theKashey/use-callback-ref/issues"},"license":"MIT"}