1.0.0 • Published 9 months ago

@nanostores/solid v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Nano Store Solid

Solid integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores.

  • Small. Less than 1 KB. Zero dependencies.
  • Fast. With small atomic and derived stores, you do not need to call the selector function for all components on every store change.
  • Tree Shakable. The chunk contains only stores used by components in the chunk.
  • Was designed to move logic from components to stores.
  • It has good TypeScript support.

Installation

npm install nanostores @nanostores/solid

Usage:

// store.ts
import { atom } from 'nanostores';

export const $counter = atom(0);

export const increase = () => {
  $counter.set($counter.get() + 1);
}
import { useStore } from '@nanostores/solid';
import { $counter, increase } from './store';

function Counter() {
  const count = useStore($counter);
  return <h1>{count()} around here ...</h1>;
}

function Controls() {
  return <button onClick={increase}>one up</button>;
}

License

MIT

1.0.0

9 months ago

0.5.0

1 year ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago