Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.88 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.88 KB

Noflux

Simple, stupid state management for JavaScript apps.

Packages

Package Version Dependencies DevDependencies Build
@noflux/state npm (scoped) Dependency Status devDependency Status Build Status
@noflux/react npm (scoped) Dependency Status devDependency Status Build Status

Example

Online debugging: https://codesandbox.io/s/z47wLwP8.

import React, { Component } from 'react';
import { connect, state } from '@noflux/react';

state.set({
  name: 'jack',
});

@connect
export default class App extends Component {
  render() {
    return (
      <div>
        <input onChange={e => state.set('name', e.target.value)} />
        <p> Hello, my name is {state.get('name')} </p>
      </div>
    )
  }
}

Documentations