https://github.com/kaokei/use-vue-service
Lightweight Vue 3 state management with dependency injection, inspired by Angular services.
https://github.com/kaokei/use-vue-service
dependency-injection di ioc javascript service state-management typescript vue3
Last synced: 17 days ago
JSON representation
Lightweight Vue 3 state management with dependency injection, inspired by Angular services.
- Host: GitHub
- URL: https://github.com/kaokei/use-vue-service
- Owner: kaokei
- License: mit
- Created: 2021-05-08T03:00:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-12T07:15:13.000Z (19 days ago)
- Last Synced: 2025-05-12T07:15:51.537Z (19 days ago)
- Topics: dependency-injection, di, ioc, javascript, service, state-management, typescript, vue3
- Language: TypeScript
- Homepage: https://kaokei.com/project/use-vue-service/
- Size: 1.05 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-angular - use-vue-service - Lightweight Vue 3 state management with dependency injection, inspired by Angular services. (Table of contents / Third Party Components)
README
npm install @kaokei/use-vue-service
[](https://github.com/kaokei/use-vue-service/actions/workflows/build.yml)
[](https://coveralls.io/github/kaokei/use-vue-service?branch=main)
[](https://npmcharts.com/compare/@kaokei/use-vue-service?minimal=true)
[](https://www.npmjs.com/package/@kaokei/use-vue-service)
[](https://www.npmjs.com/package/@kaokei/use-vue-service)
灵感来自 angular 中的服务的概念。在 angular 中不需要全局唯一的数据源 store。而是通过声明服务,以及向组件中注入服务来达到数据管理以及数据共享的。
本库也是实现了类似的效果,可以通过依赖注入实现面向服务编程、实现领域驱动开发。从而可以代替 vuex。
本库通过类来声明服务,对 typescript 支持非常棒。
- [入门指南](./docs/guide/README.md)
- [API 文档](./docs/api/README.md)
- [博客文章](./docs/note/01.父组件与子组件的理解.md)
- [codesandbox example](https://codesandbox.io/s/di-playground-zjnyv)
- [online demo](https://use-vue-service.vercel.app/)