Extras, but useful stuff

extras
Static Members
reducers
middlewares

Several utility functions / libs used by alo

Some of this functions / libs might change over time: Please read the description of the specific function / lib.

Util()
Instance Members
cloneDeep()
values()
forEach()
isFunction()
isString()
isObject()
isEqual()
isPlainObject()
isArray()
isBoolean()
uniqueId()
createStream()
combineStreams()
isStream()
immediateStream()
streamEndsOn()
mapStream()
streamOn()
scanStream()
mergeStream()
transduceStream()
createPolymorphic()
createAlo()

Access to the util namespace

util

createReducer

lib/alo.js

Access to the store constructor

createReducer()

createReducer

lib/alo.js

Access to the subscription constructor

createReducer()

createReducer

lib/alo.js

Same as new Reducer

createReducer()

createReducer

lib/alo.js

Access to the handler constructor

createReducer()

isReducer

lib/alo.js

Instanceof check for reducers

isReducer(reducer: any): boolean
Parameters
reducer (any) Argument to check if it is a reducer
Returns
boolean: true of it is a reducer, false in the other case

createStore

lib/alo.js

Same as new Store

createStore()

isStore

lib/alo.js

Instanceof check for stores

isStore(store: any, validateId: any): boolean
Parameters
store (any) Argument to check if it is a store
validateId (any)
Returns
boolean: true of it is a store, false in the other case

createTypecheck

lib/util/typecheck.js

Creates a typecheck function which throws an error if the typechecker returns false

createTypecheck(isType: function (value: any): boolean, type: string): function (value: any): (boolean | void)
Parameters
isType (function (value: any): boolean)
type (string)
Returns
function (value: any): (boolean | void)

Throws an error of type is not a string

isString(value: any): (boolean | void)
Parameters
value (any)
Returns
(boolean | void)

Reducer class TODO: Describe what this class is all about

new Reducer()
Instance Members
getId
addStore(store, fromStore)
removeStore(store, fromStore)
disable()
enable()
stop()

Subscription Constructor, is used in the Store Class to create Subscriptions to state

new Subscription(id: number, storeProtected: Object, namespace: (string | Array))

Extends Store

Parameters
id (number)
storeProtected (Object)
namespace ((string | Array))

The core of Alo. A store is the central place for application state

new Store(state: Object, id: string?)
Parameters
state (Object) Optional object to set as a start state
id (string?)
Instance Members
_stream
_reducerRelations
_middlewareRelations
_subscriptionRelations
getId()
getReducer()
addReducer(reducer)
removeReducer(reducer)
getMiddleware(id?)
addMiddleware()
getSubscription()
addSubscription()
removeSubscription()
createReducer()
getStream()
getData()
dispatch(action)

setCustomizerFunction

lib/util/customizer.js
setCustomizerFunction

Should be called in the constructor of the parent

constructParent(parentObject: any)
Parameters
parentObject (any)

removeMiddleware

lib/store/store.js

Removes a middleware

removeMiddleware(id: (id | Middleware)): Store
Parameters
id ((id | Middleware)) of middleware or middleware
Returns
Store: this