1.0.76 • Published 6 years ago
nexustate-react v1.0.76
Description
This package is used to manage state in react using nexustate
Basic Usage
install
npm install --save nexustate-react
use
import { withNexustate } from 'nexustate-react';
import React, { Component } from 'react';
class ExampleComponent extends Component {
componentWillMount() {
this.props.nexus.listen({ key: 'example', initialLoad: true });
}
randomExample = () => {
this.props.nexus.setKey('example', '' + (Math.random() * 100));
}
render() {
const { example } = this.props.data;
return (
<div>
<div>{example}</div>
<button onClick={this.randomExample}>Randomize</button>
</div>
);
}
}
export default withNexustate(ExampleComponent);
1.0.76
6 years ago
1.0.75
6 years ago
1.0.74
6 years ago
1.0.73
6 years ago
1.0.72
6 years ago
1.0.71
6 years ago
1.0.70
6 years ago
1.0.69
6 years ago
1.0.68
6 years ago
1.0.67
6 years ago
1.0.66
6 years ago
1.0.65
6 years ago
1.0.64
6 years ago
1.0.63
6 years ago
1.0.62
6 years ago
1.0.61
6 years ago
1.0.60
6 years ago
1.0.59
6 years ago
1.0.58
6 years ago
1.0.57
6 years ago
1.0.56
6 years ago
1.0.55
6 years ago