{"_id":"@3yourmind/vue-hooks","_rev":"18-543625818268e3e3c011c943bf24df8e","name":"@3yourmind/vue-hooks","dist-tags":{"latest":"2.0.1"},"versions":{"2.0.1":{"name":"@3yourmind/vue-hooks","version":"2.0.1","keywords":["vue","vue-use","vue-hooks","vue-function-api","vue-composition-api"],"author":{"url":"https://qwq.cat","name":"u3u","email":"qwq@qwq.cat"},"license":"MIT","_id":"@3yourmind/vue-hooks@2.0.1","maintainers":[{"name":"melvinv","email":"melvinvangent@gmail.com"},{"name":"cso_","email":"cso@3yourmind.com"},{"name":"nhirschfeld","email":"nh@3yourmind.com"},{"name":"3yd_developer","email":"fb+devtoken@3yourmind.com"},{"name":"tomquinonero","email":"tquinonero@gmail.com"},{"name":"drazious","email":"amr.m.draz@gmail.com"},{"name":"felix_bauer","email":"fb@3yourmind.com"},{"name":"mes3yd","email":"mes@3yourmind.com"},{"name":"dodekeract","email":"npmjs.com@dodekeract.com"},{"name":"dennis_hezel","email":"dh@3yourmind.com"}],"homepage":"https://github.com/u3u/vue-hooks#readme","bugs":{"url":"https://github.com/u3u/vue-hooks/issues"},"dist":{"shasum":"4dac3ac8133a1c55f6ba9071185f2689a69f033d","tarball":"https://registry.npmjs.org/@3yourmind/vue-hooks/-/vue-hooks-2.0.1.tgz","fileCount":80,"integrity":"sha512-Vuo4kuV1CkNG1+O945P/d1f2S4NQRGAXY4+MKtbdMRpaCUv5uDIRDHnJswp+Z1ZZXeDpKOtHtcpqEy+/qsUPdQ==","signatures":[{"sig":"MEUCIQDJppf796e+Mq8KMFIH35xaF84iC1UgDLBRh9qAkfRqqgIge/l+caK1OX7nNo02pZPqJmWYTcFLxWAQEWWY9RElVM8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqehWCRA9TVsSAnZWagAAlvwQAJIA0aHcKalSh8iAxFNk\njz87StNt2cVij3rJBNR1ruwwPnWvDrKCa2dQN0jSPuVUPfnkK6wsSV8PqH0/\n9e3qOOmsz1neFQ0xqsechaMh2fv6fHQ0nlwGkzAn4sNAtHSkRNeMop177SId\nyDn3SrkeCsFhsTr5TWTuKIfvvKK+qlcY7lBYVmqdmJxtO4DN9OY8J4oCFJI2\nQodRIZS2618pZi1EnywYUOe5alEqhMDUPzteG1UEkji85fqAK2iftgwDU78R\nwALQaIUPwTIQnrCX3IUcw6qayMzvcz1bgpsYrZOBpjmfU+mA947H5BrXxjZ4\nzH3CKEWPIF7GYqHSNSgFECb3DM7CVOdNOsrO+ut4ztpcu9PU5BIUeO4azbzl\nJINEaQc6ShwNfAvFd+4lziSxGKDoC7ZThdUAoT4m6UlOF7wYaFUaWty1PJpN\nkoilG1O7slC0HBomKiBytCE9msUsd6OHH6dn2/s/FoWmhvCr/MPwFDzFF5vG\nU/vvGmapQn2Pwpj4dS5/L8abafMPd84+ex0BOA6MsLjMZglMFW+98zb6+8u4\njMp8SZ3BAfbDOK30Rg7MC6Tc4NbIw/1R4ugPRgBl5Gwfk7pPwvCsnNU9RJgn\nIe3sgFoMvD2PEqk+yiGuN19NKn/Z2CUIBuGszXDcyyHsoKDH3wDpkNZmJE2h\ngN+y\r\n=7qxp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","module":"esm/index.js","engines":{"node":">=10.16.0"},"gitHead":"ca8f3ba224c4a59722bf2acba12eac0de4530e66","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"scripts":{"lint":"eslint 'src/**/*.ts'","test":"jest","build":"yarn clean && yarn build:cjs && yarn build:es","clean":"rimraf lib esm","start":"yarn storybook","format":"prettier '**/*.{ts,md,mdx}' --write","release":"semantic-release","build:es":"tsc -m esNext --outDir esm","build:cjs":"tsc","storybook":"start-storybook -p 3000","lint:types":"tsc --noEmit","test:watch":"jest --watch","lint:prettier":"prettier '**/*.{ts,md,mdx}' --check","prepublishOnly":"yarn test && yarn build","storybook:build":"build-storybook"},"typings":"lib/index.d.ts","_npmUser":{"name":"drazious","email":"amr.m.draz@gmail.com"},"gitHooks":{"commit-msg":"commitlint -E GIT_PARAMS","pre-commit":"lint-staged"},"repository":{"url":"git+https://github.com/u3u/vue-hooks.git","type":"git"},"_npmVersion":"6.10.2","description":"⚡️ Awesome Vue Hooks","directories":{},"lint-staged":{"*.ts":["eslint --fix"],"*.{ts,md,mdx}":["prettier --write","prettier --check","git add"]},"_nodeVersion":"12.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vue":"^2.6.10","jest":"^24.8.0","vuex":"^3.1.1","eslint":"^6.2.2","rimraf":"^3.0.0","yorkie":"^2.0.0","prismjs":"^1.17.1","prettier":"^1.18.2","typescript":"^3.5.3","vue-loader":"^15.7.1","vue-router":"^3.1.2","@babel/core":"^7.5.5","@types/jest":"^24.0.18","@types/node":"^12.7.2","lint-staged":"^9.2.3","markdown-it":"^9.1.0","babel-loader":"^8.0.6","@storybook/vue":"^5.1.11","@commitlint/cli":"^8.1.0","@vue/test-utils":"^1.0.0-beta.29","vue-tsx-support":"^2.3.1","babel-preset-vue":"^2.0.2","match-media-mock":"^0.1.1","semantic-release":"^15.13.24","@babel/preset-env":"^7.5.5","markdown-it-prism":"^2.0.2","@storybook/theming":"^5.1.11","markdown-it-loader":"^0.7.0","github-markdown-css":"^3.0.1","@vue/composition-api":"^0.2.0","all-contributors-cli":"^6.8.1","eslint-plugin-import":"^2.18.2","@semantic-release/git":"^7.0.16","@types/storybook__vue":"^5.0.2","@vue/babel-preset-jsx":"^1.1.0","vue-template-compiler":"^2.6.10","@storybook/addon-knobs":"^5.1.11","@storybook/addon-notes":"^5.1.11","eslint-config-prettier":"^6.1.0","eslint-plugin-prettier":"^3.1.0","@babel/preset-typescript":"^7.3.3","@typescript-eslint/parser":"^2.0.0","eslint-config-airbnb-base":"^14.0.0","@semantic-release/changelog":"^3.0.4","markdown-it-highlight-lines":"^1.0.2","markdown-it-link-attributes":"^2.1.0","@commitlint/config-conventional":"^8.1.0"},"_npmOperationalInternal":{"tmp":"tmp/vue-hooks_2.0.1_1571416149650_0.3263365043228239","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-10-18T16:29:09.469Z","modified":"2026-05-26T13:13:35.619Z","2.0.1":"2019-10-18T16:29:09.829Z"},"bugs":{"url":"https://github.com/u3u/vue-hooks/issues"},"author":{"url":"https://qwq.cat","name":"u3u","email":"qwq@qwq.cat"},"license":"MIT","homepage":"https://github.com/u3u/vue-hooks#readme","keywords":["vue","vue-use","vue-hooks","vue-function-api","vue-composition-api"],"repository":{"url":"git+https://github.com/u3u/vue-hooks.git","type":"git"},"description":"⚡️ Awesome Vue Hooks","maintainers":[{"email":"fb@3yourmind.com","name":"felix_bauer"},{"email":"dh@3yourmind.com","name":"dennis_hezel"},{"email":"fb+devtoken@3yourmind.com","name":"3yd_developer"},{"email":"sb-dev@outlook.com","name":"santiagoballadares"},{"email":"mv@3yourmind.com","name":"moritzvetter"}],"readme":"# vue-hooks [![NPM Version](https://img.shields.io/npm/v/@u3u/vue-hooks.svg)](https://www.npmjs.com/package/@u3u/vue-hooks) [![Build Status](https://img.shields.io/travis/u3u/vue-hooks/master.svg)](https://travis-ci.org/u3u/vue-hooks) [![Code Coverage](https://img.shields.io/codecov/c/github/u3u/vue-hooks.svg)](https://codecov.io/gh/u3u/vue-hooks)\n\n> ⚡️ Awesome Vue Hooks\n\nUsing [`@vue/composition-api`](https://github.com/vuejs/composition-api) to implement useful vue hooks.  \nVue 3.0 has not been released yet, it allows you to use functional-based components in advance.\n\n⚠️ 2.x has been switched to `@vue/composition-api`, if you are using version 1.x please use [`vue-function-api`](https://npmjs.com/vue-function-api)\n\n## Install\n\n```sh\nyarn add @vue/composition-api @u3u/vue-hooks\n```\n\n## Documentation [![Netlify Status](https://api.netlify.com/api/v1/badges/e93d1698-f766-4529-b8e0-91fa1162d4cb/deploy-status)](https://app.netlify.com/sites/vue-hooks/deploys)\n\nDocs are available at <https://vue-hooks.netlify.com>\n\n## Usage\n\n[![Edit Vue Hooks Examples](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/vue-template-66f2o?expanddevtools=1&fontsize=12&module=%2Fsrc%2FApp.vue)\n\n```js\nimport Vue from 'vue';\nimport VueCompositionAPI from '@vue/composition-api';\nimport hooks from '@u3u/vue-hooks';\n\nVue.use(hooks);\nVue.use(VueCompositionAPI); // Don't forget to use the plugin!\n```\n\n```jsx\nimport { createComponent } from '@vue/composition-api';\nimport { useWindowSize } from '@u3u/vue-hooks';\n\nexport default createComponent({\n  setup() {\n    const { width, height, widthPixel, heightPixel } = useWindowSize();\n    return { width, height, widthPixel, heightPixel };\n  },\n\n  render() {\n    const { width, height, widthPixel, heightPixel } = this;\n    return (\n      <div id=\"app\" style={{ width: widthPixel, height: heightPixel }}>\n        dynamic window size: {width}, {height}\n      </div>\n    );\n  },\n});\n```\n\n## Hooks\n\n- [`useWindowSize`](https://vue-hooks.netlify.com/?path=/story/usewindowsize--docs) &mdash; Tracks `window` dimensions.\n- [`useCounter`](https://vue-hooks.netlify.com/?path=/story/usecounter--docs) &mdash; Tracks state of a number.\n- [`usePrevious`](https://vue-hooks.netlify.com/?path=/story/useprevious--docs) &mdash; Returns the previous state or props.\n- [`useRouter`](https://vue-hooks.netlify.com/?path=/story/userouter--docs) &mdash; A hook for [`vue-router`](https://github.com/vuejs/vue-router).\n- [`useStore`](https://vue-hooks.netlify.com/?path=/story/usestore--docs) &mdash; A hook for [`vuex`](https://github.com/vuejs/vuex).\n- [`useState`](https://vue-hooks.netlify.com/?path=/story/usestate--docs) &mdash; A hook for [`mapState`](https://vuex.vuejs.org/api/#mapstate).\n- [`useGetters`](https://vue-hooks.netlify.com/?path=/story/usegetters--docs) &mdash; A hook for [`mapGetters`](https://vuex.vuejs.org/api/#mapgetters).\n- [`useMutations`](https://vue-hooks.netlify.com/?path=/story/usemutations--docs) &mdash; A hook for [`mapMutations`](https://vuex.vuejs.org/api/#mapmutations).\n- [`useActions`](https://vue-hooks.netlify.com/?path=/story/useactions--docs) &mdash; A hook for [`mapActions`](https://vuex.vuejs.org/api/#mapactions).\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b feat/new-hook`\n3. Commit your changes: `git commit -am 'feat(hooks): add a new hook'`\n4. Push to the branch: `git push origin feat/new-hook`\n5. Submit a pull request :D\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://qwq.cat\"><img src=\"https://avatars2.githubusercontent.com/u/20062482?v=4\" width=\"100px;\" alt=\"u3u\"/><br /><sub><b>u3u</b></sub></a><br /><a href=\"https://github.com/u3u/vue-hooks/commits?author=u3u\" title=\"Code\">💻</a> <a href=\"https://github.com/u3u/vue-hooks/commits?author=u3u\" title=\"Documentation\">📖</a> <a href=\"#example-u3u\" title=\"Examples\">💡</a> <a href=\"https://github.com/u3u/vue-hooks/commits?author=u3u\" title=\"Tests\">⚠️</a></td>\n  </tr>\n</table>\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}