AgileHOC is a Higher-Order Component, that helps us to bind States to our React Component.
AgileHOC gets wrapped around our React Class Component, to
ensure that our Class Component rerender, whenever a bound State mutates.
output of the passed States gets merged into the
props of the Class Component.
The property where the State Value is represented in the
props is named after the State Key.
If our State has no key, be aware that you have to pass it in Object shape into the AgileHOC,
so that it properly can be merged into the
props of the Component.
But it is recommended to use the direct State Value anyway, because it is more reliable and typesafe.
We are not limited to States, we can bind any Agile Sub Instances that own
observer to a React Component.
Agile Sub Instances with
- Collection (exception since it has no
Direct Value: Hello Stranger!
Props Value: Hello Stranger!
AgileHOC is nearly 100% typesafe.
But the State Values that get merged into the
props aren't typesafe.
Because of that reason we recommend using the direct State Value (
|ComponentClass||Component to which the passed Agile Sub Instances get applied||Yes|
|DepsType||Agile Sub Instances that get bound to the Component||Yes|
|string | number||Key/Name of Observer that gets created. Mainly thought for Debugging.||No|
|Agile||To which Agile Instance the State get bound. Gets autodetect if only one Agile Instance exists.||No|
AgileHOC returns a modified version of the React Component that got passed in.