1.0.15 • Published 4 years ago

@jswork/next-react-active-state v1.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

next-react-active-state

Active state special for react based on next-active-state.

version license size download

installation

npm install -S @jswork/next-react-active-state

apis

apiparamsdescription
build-Get state and sync event handler.

usage

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();
  })
);


<form>
  <div className="row">
    <label htmlFor="username"> username: </label>
    <input type="text" name="username" onChange={sync('username')} />
  </div>
  <div className="row">
    <label htmlFor="email"> email: </label>
    <input type="text" name="email" onChange={sync('email')}/>
  </div>
  <div className="row">
    <label htmlFor="address"> email: </label>
    <input type="text" name="formData[address]" onChange={sync()}/>
  </div>
</form>

license

Code released under the MIT license.

1.0.15

4 years ago

1.0.14

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago