effector / reflect

Easily render React components with everything you love from ☄️ effector.
https://reflect.effector.dev/
81 stars 8 forks source link

Combine store state with props to create prop for view #13

Open sergeysova opened 3 years ago

sergeysova commented 3 years ago
const B = reflect({
  view: A,
  bind: {
    foo: $data,
  },
  mapProps: {
    bar: { source: $data, fn: (data, props) => data[props.key] }
  },
})
azinit commented 3 years ago

Still actual!)

igorkamyshev commented 1 year ago

Sounds kinda Sourced fields from Farfetched 🤔

igorkamyshev commented 1 year ago

So, I'm going to stick with the following API:

const B = reflect({
  view: A,
  bind: {
    foo: $data,
    bar: { source: $data, fn: (data, props) => data[props.key] }
  },
})

PR will be done in a week 🤗

igorkamyshev commented 2 months ago

I forgot to write down the result. I tried, and was unable to beat TS 😣