reflect icon indicating copy to clipboard operation
reflect copied to clipboard

Combine store state with props to create prop for view

Open sergeysova opened this issue 4 years ago • 4 comments

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

sergeysova avatar Apr 14 '21 09:04 sergeysova

Still actual!)

azinit avatar Jun 26 '21 10:06 azinit

Sounds kinda Sourced fields from Farfetched 🤔

igorkamyshev avatar Mar 01 '23 03:03 igorkamyshev

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 avatar Mar 01 '23 09:03 igorkamyshev

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

igorkamyshev avatar Aug 21 '24 07:08 igorkamyshev