@trysound/compose v1.0.1
@trysound/compose 
HOC library for inferno
API
compose()
compose(...functions: Array<Function>): FunctionUse to compose multiple higher-order components into a single higher-order component. This works exactly like the function of the same name in Redux.
mapProps()
mapProps(
propsMapper: (ownerProps: Object) => Object,
): HigherOrderComponentAccepts a function that maps owner props to a new collection of props that are passed to the base component.
withProps()
withProps(
createProps: (ownerProps: Object) => Object | Object
): HigherOrderComponentLike mapProps(), except the newly created props are merged with the owner props.
withPropsOnChange()
withPropsOnChange(
propsKeys: Array<string>,
createProps: (ownerProps: Object) => Object
): HigherOrderComponentLike withProps(), except the new props are only created when one of the owner props specified by propsKeys changes. This helps ensure that expensive computations inside createProps() are only executed when necessary.
withHandlers()
withHandlers(
handlerCreators: {
[handlerName: string]: (props: Object, ...args) => void
}
): HigherOrderComponentTakes an object map of handler creators.
withState()
withState(
stateName: string,
stateUpdaterName: string,
initialState: any | (props: Object) => any
): HigherOrderComponentPasses two additional props to the base component: a state value, and a function to update that state value. The state updater has the following signature:
stateUpdater<T>((prevValue: T) => T): void
stateUpdater(newValue: any): void