0.1.0 • Published 2 years ago

liten-store v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Liten-store

Very little store for React.

Motivation

I was inspired by recoil, but I didn't like the size and number of ways to solve one problem, I wanted to do something super small to communicate a couple of components in React.

📦 Installation

npm i liten-store

The Basics

Let’s take a look at the basic usage:

Step 1: Create your store

// file stores/counterStore.ts

const counterStore = createStore(0);

Step 2: Use hook useStore to get value and setter

The setter interface fully corresponds to the react setter interface.

// in your component

const [value, setValue] = useStore<number>(counterStore);

Enjoy)

0.1.0

2 years ago

0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago