0.4.0 • Published 8 years ago

condux v0.4.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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 --save

API

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

ParamTypeDescription
serverobjecthttp server (express, etc)
optionsobjectpasses 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

ParamTypeDescription
actionNamestring
optionsobjectReflux 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

ParamType
actionNamesarray

-

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

ParamTypeDescription
topicstringthe name of the channel/frequency the datastore triggers to
storeDefinitionobjectstore 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

ParamTypeDescription
topicstringthe name of the newly created channel

-

Condux.Adapter

use Adapter when your app already has a sockjs service

Kind: static property of Condux

ParamTypeDescription
serviceobjecta SockJS server instance created elsewhere with <SockJS>.createServer

-