# condux

> An over-the-wire unidirectional data-flow architecture utilizing Reflux as the flux pattern implementation and SockJS as the websocket implementation.

Latest version **0.4.0** (published 2015-11-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2015-11-08 |
| First published | 2015-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ethan Ferrari |
| Maintainers | epferrari |
| Keywords | reflux, react, flux, reactive, websocket, bi-directional, sockjs |

## Links

- npm: https://www.npmjs.com/package/condux
- Repository: https://epferrari@github.com/epferrari/condux
- Homepage: https://github.com/epferrari/condux#readme
- Issues: https://github.com/epferrari/condux/issues
- npm.io page: https://npm.io/package/condux

## Dependencies (4)

- [events](https://npm.io/package/events.md) ^1.0.2
- [sockjs](https://npm.io/package/sockjs.md) git+https://github.com/epferrari/sockjs-node.git#feature/xhrMod
- [stream](https://npm.io/package/stream.md) 0.0.2
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2015-11-08

## README

# Condux

An over-the-wire unidirectional data-flow architecture utilizing Reflux as the flux pattern implementation and SockJS as the websocket implementation. Use conjunction with [condux-client](https://github.com/epferrari/condux-client).

#### Installation

	npm install condux --save


#### API
<a name="Condux"></a>
## Condux()
Builds and returns a Condux Server. A Condux Server listens to client actions via its private `CLIENT_ACTIONS`
channel. Client actions are registered using `<ConduxServer>.createAction` or `<ConduxServer>.createActions`.
Actions __must__ be symmetrically mirrored on the client using `<ConduxClient>`'s methods
`<ConduxClient>.createAction` and `<ConduxClient>.createActions`

**Kind**: global function  

* [Condux()](#Condux)
  * _instance_
    * [.attach(server, options)](#Condux+attach)
    * [.createAction(actionName, options)](#Condux+createAction)
    * [.createActions(actionNames)](#Condux+createActions)
    * [.createStore(topic, storeDefinition)](#Condux+createStore) ⇒ <code>object</code>
    * [.onNewChannel(topic)](#Condux+onNewChannel)
  * _static_
    * [.Adapter](#Condux.Adapter)


-

<a name="Condux+attach"></a>
### condux.attach(server, options)
convenience method for `<SockJS>.installHandlers(server,options)`

**Kind**: instance method of <code>[Condux](#Condux)</code>  

| Param | Type | Description |
| --- | --- | --- |
| server | <code>object</code> | http server (express, etc) |
| options | <code>object</code> | passes options as <SockJS>.installHandlers' second argument |


-

<a name="Condux+createAction"></a>
### condux.createAction(actionName, options)
wrapper for `Reflux.createAction()` that ensures actions are registered with the
Nexus instance. The `ConduxServer` instance acts as a dispatch for all client actions
registered with it.

**Kind**: instance method of <code>[Condux](#Condux)</code>  

| Param | Type | Description |
| --- | --- | --- |
| actionName | <code>string</code> |  |
| options | <code>object</code> | Reflux action options object |


-

<a name="Condux+createActions"></a>
### condux.createActions(actionNames)
wrapper for Reflux.createActions() that ensures each Action is registered on the server nexus

**Kind**: instance method of <code>[Condux](#Condux)</code>  

| Param | Type |
| --- | --- |
| actionNames | <code>array</code> | 


-

<a name="Condux+createStore"></a>
### condux.createStore(topic, storeDefinition) ⇒ <code>object</code>
wrapper for Reflux.createActions() that ensures each Action is registered on the server nexus

**Kind**: instance method of <code>[Condux](#Condux)</code>  
**Returns**: <code>object</code> - a Reflux store  

| Param | Type | Description |
| --- | --- | --- |
| topic | <code>string</code> | the name of the channel/frequency the datastore triggers to |
| storeDefinition | <code>object</code> | store methods object, like the one passed to `Reflux.createStore` |


-

<a name="Condux+onNewChannel"></a>
### condux.onNewChannel(topic)
dummy hook for when a new channel is created

**Kind**: instance method of <code>[Condux](#Condux)</code>  

| Param | Type | Description |
| --- | --- | --- |
| topic | <code>string</code> | the name of the newly created channel |


-

<a name="Condux.Adapter"></a>
### Condux.Adapter
use Adapter when your app already has a sockjs service

**Kind**: static property of <code>[Condux](#Condux)</code>  

| Param | Type | Description |
| --- | --- | --- |
| service | <code>object</code> | a SockJS server instance created elsewhere with `<SockJS>.createServer` |


-

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