https://github.com/afeiship/next-react-active-state
Active state special for react based on next-active-state.
https://github.com/afeiship/next-react-active-state
active context mobx next react redux state
Last synced: 13 days ago
JSON representation
Active state special for react based on next-active-state.
- Host: GitHub
- URL: https://github.com/afeiship/next-react-active-state
- Owner: afeiship
- License: mit
- Created: 2020-03-20T13:10:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-07T05:26:46.000Z (over 4 years ago)
- Last Synced: 2025-03-22T10:38:14.423Z (about 1 year ago)
- Topics: active, context, mobx, next, react, redux, state
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-react-active-state
> Active state special for react based on next-active-state.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
npm install -S @jswork/next-react-active-state
```
## apis
| api | params | description |
| ----- | ------ | --------------------------------- |
| build | - | Get state and sync event handler. |
## usage
```js
import NxReactActiveState from '@jswork/next-react-active-state';
import useForceUpdate from '@jswork/use-force-update';
const forceUpdate = useForceUpdate();
const {
current: { state, sync },
} = useRef(
NxReactActiveState.build({}, () => {
console.log('changed main:', state);
forceUpdate();
})
);
username:
email:
email:
```
## license
Code released under [the MIT license](https://github.com/afeiship/next-react-active-state/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-react-active-state
[version-url]: https://npmjs.org/package/@jswork/next-react-active-state
[license-image]: https://img.shields.io/npm/l/@jswork/next-react-active-state
[license-url]: https://github.com/afeiship/next-react-active-state/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-react-active-state
[size-url]: https://github.com/afeiship/next-react-active-state/blob/master/dist/next-react-active-state.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-react-active-state
[download-url]: https://www.npmjs.com/package/@jswork/next-react-active-state