@vuezy/teeny-store
v1.0.0
Published
A stupidly small and simple store for state and effect management
Downloads
4
Maintainers
Readme
Teeny Store
A stupidly small and simple store for state and effect management. You can easily use it in any modern JavaScript/TypeScript project. Read the docs here.
Installation
You can install Teeny Store via a package manager, or load it directly in the browser using a CDN.
npm install @vuezy/teeny-store<script src="https://cdn.jsdelivr.net/npm/@vuezy/teeny-store"></script>Usage
import { createStore } from "@vuezy/teeny-store";
export function init() {
const store = createStore(0);
store.useEffect(renderCount, (state) => [state]);
function renderCount(count) {
const countEl = document.getElementById('count');
if (countEl) {
countEl.textContent = count;
}
}
function decrement() {
store.setState((state) => state - 1);
}
function increment() {
store.setState((state) => state + 1);
}
document.getElementById('decrement-btn')?.addEventListener('click', decrement);
document.getElementById('increment-btn')?.addEventListener('click', increment);
};License
MIT
Copyright (c) 2025-PRESENT Shane Christian Kwok
