You can find the full documentation on the website.
Useful JavaScript base classes for efficient and quick solutions to common problems.
npm install base-classes
The Store
is a base class that provides the necessary methods and attributes to organize state management efficiently and easily.
import {Store} from 'base-classes'
const {Store} = require('base-classes')
import {Store} from 'base-classes'
class MyClass extends Store {
state = { count: 1 }
}
const myClass = new MyClass()
myClass.subscribe((state, prevState) => {
console.log('state changed:', state)
})
myClass.updateState((state) => {
return {...state, count: 2}
})
Read our contributing guide to learn about our development process.
This project has adopted the Contributor Covenant as its Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.