This function, along with unit tests, will be the base for other functions to follow.
There will be two kinds of functions:
That adds props
That processes/transforms the props
One that adds props, will look like this:
function withFoo() {
// the returned function here follows same API as the function that `observe` HoC receives
return function (app, props$) {
// value returned from here will be merged to final props stream
return {
foo: 'foo value here',
};
};
}
One that transforms the props further (API still a WIP):
function capitalizeFoo() {
return function (app, props$) {
// return a function for processing
return function (processedProps) {
processedProps.foo = processedProps.toUpperString();
return processedProps;
};
};
}
This function, along with unit tests, will be the base for other functions to follow.
There will be two kinds of functions:
One that adds props, will look like this:
One that transforms the props further (API still a WIP):