Releases: pfgray/chainable-components
Releases · pfgray/chainable-components
v1.7.0
Changes:
- Added fp-ts Monad typeclass for chainable components:
import { chainableComponent } from 'chainable-components/dist/lib/fpts'- Added
DoBuilderexport which binds the generalizedDofrom fp-ts-contrib to chainable componentsL
import { DoBuilder } from 'chainable-components/dist/lib/fpts'
DoBuilder
.bind('outer', withState(0))
.bindL('inner', ({outer}) => withState(10))
.done()
.render(({inner, outer}) => (
<div>...</div>
))- Added
ChainableComponent.allT()which uses improved mapped type support for a simpler version ofallwithout losing inference:
ChainableComponent.allT(
withState('string value'),
withState(1),
).render(([str, num]) => (
<div></div>
))- Improved type inference for
fromRenderPropandfromNonStandardRenderProp.
v1.5.2
Adds DoRender, which is like Do, but automatically renders your Chainable chain:
ChainableComponent.DoRender(
withState(5),
() => withState(5),
() => withState('foo'),
(foo, inner, outer) =>
<div>
{foo.value}
<div>outer: {outer.value}</div>
<button onClick={() => outer.update(outer.value + 1)}>+</button>
<div>inner: {inner.value}</div>
<button onClick={() => inner.update(inner.value + 1)}>+</button>
</div>
)v1.5.1
v1.5.0
v1.3.0
- Renamed
ap->render - Implemented
apas the ap from fantasy-land