Skip to content

mmmrks/stock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StockPile

Simple state & store -plugin for VueJS.

Installation

npm install @mmmrks/vue-stockpile

OR

<script src="https://cdn.jsdelivr.net/npm/package@version/file"></sript>

Usage

import StockPile from '@mmmrks/vue-stockpile'

Vue.use(StockPile , new StockPile.Stash({
  pile: { // mandatory
   count: 0
  },
  static: { // optional
    localhost: "http://localhost:3000"
  }
}))

Unlike pile -stash, data inside static -stash can only be written once and is not mandatory.

Access the data:

this.$stock.pile.count
<section>{{$stock.pile.count}}</section>

Set (stash) data:

this.stock.pile.stash("count", this.$stock.pile.count + 1);

Remove (unstash) data:

this.stock.pile.unstash("count");

!! static -stash works just like pile stash except you can set values only once and added values can't be unstashed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published