1.2.1 • Published 2 years ago

@softvisio/vue-store v1.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

:information_source: Please, see the full project documentation here: https://softvisio-node.github.io/vue-store/.

Introduction

Create store from ES class.

Install

npm i @softvisio/vue-store

Usage

import VueStore from "@softvisio/vue-store";

class Store extends VueStore {

    // non-reactive properties
    __prop1;
    _prop2 = 1;

    // reactive properties
    state11;          // reactive state property
    _state1 = "test"; // protected reactive state property with initial value

    // reactive getter
    get getter1() {
        return this.state1 + _protectedState1;
    }

    // setter is just setter, no special behaviour is defined
    set getter1 () {}

    // actions
    async action1 (value )  {
        this.state1 += value;
    }
};

export default Store.new( "my-store-id" );
  • All enumerable properties become reactive state properties, except properties starts with __.
  • All get accessors become reactive getters, returned values are cached (refer to the vuex getters documentation).
1.2.0

2 years ago

1.1.0

2 years ago

1.2.1

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago