{"_id":"@chenxxx/vue-hooks","_rev":"1-78c0305963b51ec123a6449414829821","name":"@chenxxx/vue-hooks","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@chenxxx/vue-hooks","description":"⚡️ Awesome Vue Hooks","version":"0.1.0","publishConfig":{"access":"public"},"keywords":["vue","vue-use","vue-hooks","vue-function-api","vue-composition-api"],"main":"lib/index.js","module":"esm/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","scripts":{"start":"yarn storybook","storybook":"start-storybook -p 3000","storybook:build":"build-storybook","test":"jest","test:watch":"jest --watch","build:cjs":"tsc","build:es":"tsc -m esNext --outDir esm","build":"yarn clean && yarn build:cjs && yarn build:es","clean":"rimraf lib esm","lint":"eslint 'src/**/*.ts'","lint:types":"tsc --noEmit","lint:prettier":"prettier '**/*.{ts,md,mdx}' --check","format":"prettier '**/*.{ts,md,mdx}' --write","release":"semantic-release","prepublishOnly":"yarn test && yarn build"},"authors":[{"name":"u3u","email":"qwq@qwq.cat"},{"name":"cjfff","email":"cjfff1996@gmali.com"}],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjfff/vue-hooks.git"},"bugs":{"url":"https://github.com/cjfff/vue-hooks/issues"},"homepage":"https://github.com/cjfff/vue-hooks#readme","engines":{"node":">=10.16.0"},"devDependencies":{"dayjs":"^1.8.15","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","@babel/preset-typescript":"^7.3.3","@commitlint/cli":"^8.1.0","@commitlint/config-conventional":"^8.1.0","@semantic-release/changelog":"^3.0.4","@semantic-release/git":"^7.0.16","@storybook/addon-knobs":"^5.1.11","@storybook/addon-notes":"^5.1.11","@storybook/theming":"^5.1.11","@storybook/vue":"^5.1.11","@types/jest":"^24.0.18","@types/node":"^12.7.2","@types/storybook__vue":"^5.0.2","@typescript-eslint/parser":"^2.0.0","@vue/babel-preset-jsx":"^1.1.0","@vue/composition-api":"^0.2.0","@vue/test-utils":"^1.0.0-beta.29","all-contributors-cli":"^6.8.1","babel-loader":"^8.0.6","babel-preset-vue":"^2.0.2","eslint":"^6.2.2","eslint-config-airbnb-base":"^14.0.0","eslint-config-prettier":"^6.1.0","eslint-plugin-import":"^2.18.2","eslint-plugin-prettier":"^3.1.0","github-markdown-css":"^3.0.1","jest":"^24.8.0","lint-staged":"^9.2.3","markdown-it":"^9.1.0","markdown-it-highlight-lines":"^1.0.2","markdown-it-link-attributes":"^2.1.0","markdown-it-loader":"^0.7.0","markdown-it-prism":"^2.0.2","match-media-mock":"^0.1.1","prettier":"^1.18.2","prismjs":"^1.17.1","rimraf":"^3.0.0","semantic-release":"^15.13.24","typescript":"^3.5.3","vue":"^2.6.10","vue-loader":"^15.7.1","vue-router":"^3.1.2","vue-template-compiler":"^2.6.10","vue-tsx-support":"^2.3.1","vuex":"^3.1.1","yorkie":"^2.0.0"},"release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"gitHooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E GIT_PARAMS"},"lint-staged":{"*.ts":["eslint --fix"],"*.{ts,md,mdx}":["prettier --write","prettier --check","git add"]},"gitHead":"88798fc00e96ab0a2e39fdc21b13e03e1551bd78","_id":"@chenxxx/vue-hooks@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0m+43BgIVeb0C84AmbytMfvc3jX885etqlLaAM9wPdE5dQhPwa1TroLBE7yE+45fsyHZnokE8Xoj089rrrIiTA==","shasum":"784cdab7f3ae8f1360281709febe2be25c71291d","tarball":"https://registry.npmjs.org/@chenxxx/vue-hooks/-/vue-hooks-0.1.0.tgz","fileCount":84,"unpackedSize":58200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfALMGCRA9TVsSAnZWagAAoTQP/0Cyn7Z3pxgRg13O67zx\nmK1R4mcojEWRifqraNkCnuXDxXdRD58vF1lAA+CmM8lmN6SU1BNTv05rwB5K\neE4a/AMb4dj1ufznl2R1kepldsM7Hj7UtC+o34wBrHB7X2oacE4itZVtBtnu\nzXg+9KtAp5pvnt0ZegwozPsh+nqgxuKsnrrr/qP2UroaUaHy3cWKw6IeMtLo\nSi1XnA30vspLVYk0sTkpjXKkMh5C5ihm2bzZx+UX65Z2XWbdKL5kzuD2dTmX\n636c+l+e8xhsSlb8G18atQCeSRYOJf1GEZ4eBFzM7JyJca+WP+K8h0ssv0Pz\n+/cdjscI4TAEaFTURJPhSCWN9Vq0pyvlKeFaFe7GTv6U+WQhYrVOiOidEV4z\nYD2Wu1SMU3bm2YpwG75WjN9uBe1+vELXATKFgVhEIabhELPUvnGqNbuAL5Xz\n6yBKwxBrh877lcCgtT2RS3IekI8RaYfGap/OENNH4XsPA386Ok6N8DjNqj97\nUHeK0+VrkUSgNQT0l135P+gRAFdG5oCOYlNysO3uLB3TU0CFyQCDbGpkzGfb\nZ4ONxryf+2OHLGTkYI21kmD/Jr2B3MQfscdScT17lHUyp4GlS7Q6ooa/3t0P\nIakVZW+sjNGawkZPUPxEfMFQF+GeacJfkMFSbH5xT7z8n9eVrswdzDsOsdBh\n2xOq\r\n=XSB7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIChqRstFZ+0o2lWFEB7UBP/H83uy94bRHnFGpahBvParAiEAsg/BAAN0IlK2KGzcqidxwJmEVTJopl53D+Pu40KYMDE="}]},"maintainers":[{"name":"cjfff","email":"cjfff1996@gmail.com"}],"_npmUser":{"name":"cjfff","email":"cjfff1996@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-hooks_0.1.0_1593881350451_0.9352938266201813"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-04T16:49:10.185Z","0.1.0":"2020-07-04T16:49:10.571Z","modified":"2022-04-04T22:39:17.383Z"},"maintainers":[{"name":"cjfff","email":"cjfff1996@gmail.com"}],"description":"⚡️ Awesome Vue Hooks","homepage":"https://github.com/cjfff/vue-hooks#readme","keywords":["vue","vue-use","vue-hooks","vue-function-api","vue-composition-api"],"repository":{"type":"git","url":"git+https://github.com/cjfff/vue-hooks.git"},"bugs":{"url":"https://github.com/cjfff/vue-hooks/issues"},"license":"MIT","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- [`useDate`](https://vue-hooks.netlify.com/?path=/story/usedate--docs) &mdash; Using [`dayjs`](https://github.com/iamkun/dayjs) to process date.\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"}