Tools based on Redux to easily integrate forms, validate and manipulate data.
flux
library and build state over EventEmitter
You need to read the awesome Redux documentation. At least the concepts.
A component Component = f(state, props)
We try to use two concepts
context
. (We do not encourage you to write any information in the context by your own). Use the Providers
instead.If I have an application
import React from 'react';
import {Provider as DomainProvider} from 'focus-redux/behaviours/domain';
import myDomains from './my-app-domains';
const MyApp = props => {
return <DomainProvider domains={myDomains}>
<Layout>
<MyChildComponentWhoNeedsInformationsFromTheDomain name='great tutorial'></MyChildComponentWhoNeedsInformationsFromTheDomain>
</Layout>
</DomainProvider>
};
Where
const MyChildComponentWhoNeedsInformationsFromTheDomain = props => {
return <div>Hello props.domain.TEXT.formatter(props.name)</div>
}
export default connectToDomains(MyChildComponentWhoNeedsInformationsFromTheDomain);
Provider(informationsToPassToTheComponentsTree) => Tree => connectToInformations(Child) => The child gets this information in its props.
// todo: