0.2.4 • Published 3 years ago

some-sync-hooks v0.2.4

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

Some Sync Hooks

Do you need some simple storage for your React states and reducers? Does your React app live in two or more tabs at once? Do you like BroadcastChannel and IndexedDB?

Some sync hooks can replicate your state across your many browser tabs!

Installation

npm i some-sync-hooks

Methods

useSyncState

Like useState but it will restore state on reload and share between tabs.

const [state, setState, ready] = useSyncState('key', { some: 'state' });

useSyncReducer

Like useReducer but it will restore state on reload and share between tabs.

const [state, dispatch, ready] = useSyncReducer('key', reducer, { some: 'state' });

License

Copyright (c) 2020, Michael Szmadzinski. (MIT License)

0.2.4

3 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago