# fluxer

> Build React/Flux app for both server and client side

Latest version **0.6.2** (published 2016-02-29) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.2 |
| Published | 2016-02-29 |
| First published | 2014-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Yuanzong Qiu |
| Maintainers | yuanzong |
| Keywords | React, Flux, fluxer |

## Links

- npm: https://www.npmjs.com/package/fluxer
- Repository: https://github.com/yuanzong/fluxer
- Issues: https://github.com/yuanzong/fluxer/issues
- npm.io page: https://npm.io/package/fluxer

## Dependencies (1)

- [serialize-javascript](https://npm.io/package/serialize-javascript.md) ^1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.6.2 (latest) — 2016-02-29
- 0.6.1 — 2016-01-26
- 0.6.0 — 2015-12-23
- 0.5.0 — 2015-04-20
- 0.4.0 — 2015-04-17
- 0.3.1 — 2015-01-18
- 0.3.0 — 2015-01-10
- 0.2.6 — 2015-01-06
- 0.2.5 — 2015-01-06
- 0.2.4 — 2014-12-12
- 0.2.3 — 2014-12-12
- 0.2.2 — 2014-12-12
- 0.2.1 — 2014-12-12
- 0.2.0 — 2014-12-12
- 0.1.1 — 2014-12-11

## README

Fluxer
======

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

Build React/Flux app that runs seamlessly on both server side and client side

Usage
-----

``` js
var appName: a string like 'my-app';
var appComponent: MyReactComponentToRender
var data: DataNeededToInitialize appComponent
```

#### server side


``` js
var fluxer = require('fluxer');
var markup = fluxer(appName, appComponent, data)
```

place markup in your favorite template, markup has format like this

``` html
<div id='{appName}-container'>
  React rendered appComponent
</div>
<script type='application/json' id='{appName}-data-script'>
  json serialized data
</script>
```

#### client side


``` js
var fluxer = require('fluxer')(document);
fluxer.render(appName, Component);
```

#### with [react-router](https://github.com/rackt/react-router)

```js

// define your routes

var routes = (
  <Route handler={appComponent} path="/">
);


// on server side

var fluxer = require('fluxer');
var Router = require('react-router');

Router.run(routes, url, function(Handler) {
  res.send(fluxer(appName, Handler, data));
});


// on client side

var fluxer = require('fluxer')(document);
var Router = require('react-router');

var initData = fluxer.getInitData(appName);
var mountNode = fluxer.getMountNode(appName);

Router.run(Routes, Router.HistoryLocation, function(Handler) {
  React.render(<Handler ...initData />, mountNode);
});
```

# install

With [npm](https://npmjs.org) do:

```
npm install --save fluxer
```

# license

MIT

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