Module: react-cmf/lib/expression

This module define expression which are just function used to be called in the way you want in your APP with a context and a payload as params
Source:

Methods

(inner) call(expression, React, payload)

expressions are registred function which can be called through configuration
Parameters:
Name Type Description
expression string | object to call
React object context
payload object will be in expression argument
Source:

(inner) get(id, context)

get an expression from it's id
Parameters:
Name Type Description
id string of the expression you want to get
context Context React context is optional
Source:

(inner) getProps(props, attrs, context, payload)

this function will try to find all props.properties that should be evaluated agains a registered function, the attrs parameter will be deprecated. Each parameter name ending with Expression will be automaticaly evaluated against their registered Expression and the result put inside a properties with name matching the original expression attributes minus the 'Expression' part
Parameters:
Name Type Description
props Object.<string, *> React props
attrs Array.<string> of attribute to get
context Context React context
payload payload optional payload to pass
Deprecated:
  • the context will be replaced by the payload
Source:

(inner) mapStateToProps(state, ownProps)

Internal: you should not have to use it This function will compute a new props object with extra props using the convention `fooExpression` will return { foo };
Parameters:
Name Type Description
state object redux state
ownProps object any props you want to process with expression
Source:

(inner) mergeProps(props)

Internal: you should not have to use it this function cleanup the object by returning a new one by removing all key that finish with Expression (ie `fooExpression`);
Parameters:
Name Type Description
props object any props object
Source:

(inner) register(id, func, context)

register an expression
Parameters:
Name Type Description
id string the id of the expression to call it later
func function the function you want to register under this id
context Context React context is optional
Source:

(inner) withExpression(Component, attrs)

Parameters:
Name Type Description
Component any
attrs *
Source: