Closed fahad19 closed 6 years ago
Development has begun in this repository: https://github.com/frintjs/frint-props
Proposal will be closed once we have our first release on npm. We can then take it from there.
Delivered in https://github.com/frintjs/frint-props
(Intended to be done outside of the monorepo)
Currently
We have
frint-react
package that ships withobserve
HoC andstreamProps
helper function that enables you to stream props to your base component.It also gives you access to
app
instance, allowing you to generate your props having access to your providers too.Problem
The streaming concept requires developers to understand RxJS and Observables, which is becoming a barrier to entry for beginners.
We can do more to make things easier.
Proposal
Given FrintJS aims to be rendering library agnostic, I propose two packages that can help developers write mostly pure functions and help avoid direct RxJS usage unless really needed for complicated use cases:
frint-utils
: Exports pure functions for composing your propsfrint-utils-react
: Composes all functions to create a React HoCExample usage
This code snippet is just for showing an example, do not take the API too seriously:
Implentation
frint-react
and RxJS will be used by thecompose
HoC internally, and should not result in adding to the bundle size significantly.I am looking at a size around
1kb
to2kB
max for the initial release.Dependencies