Skip to content

Lightweight Vue 3 state management with dependency injection, inspired by Angular services.

License

Notifications You must be signed in to change notification settings

kaokei/use-vue-service

Repository files navigation

npm install @kaokei/use-vue-service

Build Status Coverage Status Downloads Version License GitHub Created At

灵感来自 angular 中的服务的概念。在 angular 中不需要全局唯一的数据源 store。而是通过声明服务,以及向组件中注入服务来达到数据管理以及数据共享的。

本库也是实现了类似的效果,可以通过依赖注入实现面向服务编程、实现领域驱动开发。从而可以代替 vuex。

本库通过类来声明服务,对 typescript 支持非常棒。