0.4.0 • Published 5 years ago

@nicolasparada/store v0.4.0

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

JavaScript Store

Simple state container for your daily use in 400 bytes 😊

Shipped like an ES module. Load it with <script type=module>.

Example

import { createStore } from 'https://unpkg.com/@nicolasparada/store@0.4.0/store.js'

const store = createStore(0)

console.log('initial count:', store.getState())
const unsubscribe = store.subscribe(count => {
    console.log('current count:', count)
})

store.setState(1) // Set to 1.
store.setState(c => c + 1) // Increment current value.
0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago