# noflux

> a simple top down data flow implementation

Latest version **2.2.4** (published 2016-01-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install noflux
pnpm add noflux
yarn add noflux
bun add noflux
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.2.4 |
| Published | 2016-01-07 |
| First published | 2015-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | liuxijin |
| Maintainers | ssnau |
| Keywords | flux, noflux |

## Links

- npm: https://www.npmjs.com/package/noflux
- Repository: https://github.com/ssnau/noflux
- Homepage: https://github.com/ssnau/noflux#readme
- Issues: https://github.com/ssnau/noflux/issues
- npm.io page: https://npm.io/package/noflux

## Dependencies (2)

- [envify](https://npm.io/package/envify.md) ^3.0.0
- [dataton](https://npm.io/package/dataton.md) ^1.6.6

## Recent versions

- 2.2.4 (latest) — 2016-01-07
- 2.2.3 — 2015-12-23
- 2.2.2 — 2015-12-23
- 2.2.1 — 2015-12-14
- 2.2.0 — 2015-12-14
- 2.1.1 — 2015-12-03
- 2.1.0 — 2015-12-03
- 2.0.1 — 2015-12-01
- 2.0.0 — 2015-11-23
- 1.1.8 — 2015-11-06
- 1.1.7 — 2015-10-30
- 1.1.6 — 2015-10-27
- 1.1.5 — 2015-10-26
- 1.1.4 — 2015-10-26
- 1.1.3 — 2015-10-14
- … 5 more at https://npm.io/package/noflux/versions

## README

[![Build Status](https://travis-ci.org/ssnau/noflux.svg?branch=master)](https://travis-ci.org/ssnau/noflux)

noflux
--------

a simple top down data flow implementation.


install
----

```
npm install noflux
```

usage
-----

```
import {connect, state} from "noflux";
import React from "react";

state.load({
  name: 'jack'
});

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

The page will be refresh once the state changes.


API
-----

### connect

a function works as decrocation to bind a React class with `state`.
`state` will emit `change` event after its modification and the instance
of the class will be re-rendered.

### pure

a function works as decrocation to make a React class as a pure render component even though you pass cursors
as props.

### state

A instance of [dataton](http://npmjs.com/package/dataton) which implemented Copy-On-Write technique. You can:

- `load`: load data into state.
- `set`: set specific key-value for state.
- `get`: get the correspond value for the provided key.
- `cursor`: get the `cursor` from the provided path.



License
----

MIT

---
_Source: https://npm.io/package/noflux · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
