All Projects → ccforward → vue-stores

ccforward / vue-stores

Licence: MIT License
Share the root states and methods in every component.

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue-stores

useStateMachine
The <1 kb state machine hook for React
Stars: ✭ 2,231 (+13843.75%)
Mutual labels:  state-management
Vuex-Alt
An alternative approach to Vuex helpers for accessing state, getters and actions that doesn't rely on string constants.
Stars: ✭ 15 (-6.25%)
Mutual labels:  state-management
kladi
Easy to use state management library for React
Stars: ✭ 24 (+50%)
Mutual labels:  state-management
flutter modularization
[Flutter SDK V.2] - This repo will introduce you how to mastering your app with implementation Flutter Modularization in several ways
Stars: ✭ 78 (+387.5%)
Mutual labels:  state-management
xstate-viz
Visualizer for XState machines
Stars: ✭ 274 (+1612.5%)
Mutual labels:  state-management
xstate-cpp-generator
C++ State Machine generator for Xstate
Stars: ✭ 33 (+106.25%)
Mutual labels:  state-management
knockout-store
State management for Knockout apps.
Stars: ✭ 37 (+131.25%)
Mutual labels:  state-management
reactive-store
A store implementation for state management with RxJS
Stars: ✭ 29 (+81.25%)
Mutual labels:  state-management
ngx-model-hacker-news-example
Example repository with Hacker News implementation using Angular, Angular Material & ngx-model
Stars: ✭ 27 (+68.75%)
Mutual labels:  state-management
okwolo
light javascript framework to build web applications
Stars: ✭ 19 (+18.75%)
Mutual labels:  state-management
juliette
Reactive State Management Powered by RxJS
Stars: ✭ 84 (+425%)
Mutual labels:  state-management
zustood
🐻‍❄️ A modular store factory using zustand
Stars: ✭ 46 (+187.5%)
Mutual labels:  state-management
dotto.x
A tiny state manager for React, Svelte, Vue and vanilla JS
Stars: ✭ 104 (+550%)
Mutual labels:  state-management
stoxy
Stoxy is a state management API for all modern Web Technologies
Stars: ✭ 73 (+356.25%)
Mutual labels:  state-management
react-wisteria
Managing the State with the Golden Path
Stars: ✭ 18 (+12.5%)
Mutual labels:  state-management
eventrix
Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.
Stars: ✭ 35 (+118.75%)
Mutual labels:  state-management
flutter-bloc-patterns
A set of most common BLoC use cases built on top of flutter_bloc library
Stars: ✭ 58 (+262.5%)
Mutual labels:  state-management
react-smart-app
Preconfiguration React + Ant Design + State Management
Stars: ✭ 13 (-18.75%)
Mutual labels:  state-management
react-mui-pro-starter
Mix of Create React App and Material UI with set of reusable components and utilities to build professional React Applications faster.
Stars: ✭ 14 (-12.5%)
Mutual labels:  state-management
closeable-map
Application state management made simple: a Clojure map that implements java.io.Closeable.
Stars: ✭ 42 (+162.5%)
Mutual labels:  state-management

vue-stores

Share the root states and methods in every component.

详细说明

GitHub

https://github.com/ccforward/vue-stores

NPM

npm

Demo

https://ccforward.github.io/vue-stores/

Usage

install

$ npm install vue-stores --save

$ yarn add vue-stores

Root Component

main.js

import stores from 'vue-stores'
Vue.use(stores)

new Vue({
  ...  
  data: {
    state: {
      showModal: false,
      global: {
        txt: 'shared Text'
      }
    }
  },
  methods: {
    toast(){
      alert(this.state.global.txt)
    }
  }
  ...
})

Child Component

App.vue

export default {
  ...
  methods: {
    toggle(){
      this.modal = !this.modal
    }
  },
  stores: {
    txt: 'state.global.txt',
    modal: 'state.showModal',
    alert(){
      return 'toast'
    }
  }
  ...
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].