1.0.76 • Published 7 years ago

nexustate-react v1.0.76

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

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

7 years ago

1.0.75

7 years ago

1.0.74

7 years ago

1.0.73

7 years ago

1.0.72

7 years ago

1.0.71

7 years ago

1.0.70

7 years ago

1.0.69

7 years ago

1.0.68

7 years ago

1.0.67

7 years ago

1.0.66

7 years ago

1.0.65

7 years ago

1.0.64

7 years ago

1.0.63

7 years ago

1.0.62

7 years ago

1.0.61

7 years ago

1.0.60

7 years ago

1.0.59

7 years ago

1.0.58

7 years ago

1.0.57

7 years ago

1.0.56

7 years ago

1.0.55

7 years ago