condux v0.4.0
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.
Installation
npm install condux --saveAPI
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.attach(server, options)
convenience method for <SockJS>.installHandlers(server,options)
Kind: instance method of Condux
| Param | Type | Description |
|---|---|---|
| server | object | http server (express, etc) |
| options | object | passes options as .installHandlers' second argument |
-
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 Condux
| Param | Type | Description |
|---|---|---|
| actionName | string | |
| options | object | Reflux action options object |
-
condux.createActions(actionNames)
wrapper for Reflux.createActions() that ensures each Action is registered on the server nexus
Kind: instance method of Condux
| Param | Type |
|---|---|
| actionNames | array |
-
condux.createStore(topic, storeDefinition) ⇒ object
wrapper for Reflux.createActions() that ensures each Action is registered on the server nexus
Kind: instance method of Condux
Returns: object - a Reflux store
| Param | Type | Description |
|---|---|---|
| topic | string | the name of the channel/frequency the datastore triggers to |
| storeDefinition | object | store methods object, like the one passed to Reflux.createStore |
-
condux.onNewChannel(topic)
dummy hook for when a new channel is created
Kind: instance method of Condux
| Param | Type | Description |
|---|---|---|
| topic | string | the name of the newly created channel |
-
Condux.Adapter
use Adapter when your app already has a sockjs service
Kind: static property of Condux
| Param | Type | Description |
|---|---|---|
| service | object | a SockJS server instance created elsewhere with <SockJS>.createServer |
-
10 years ago