frintjs / frint-props

Compose reactive props in FrintJS applications
https://frint.js.org
MIT License
12 stars 1 forks source link

Map function behaviour is not as expected #38

Open Hajjiri opened 6 years ago

Hajjiri commented 6 years ago

Current behaviour, it maps the props asynchronously only. Expected behaviour, it maps the props as by default when component is constructed, and asynchronously.

I want to achieve the below using rxJs map,

withObservable((app, props$) => {
    return props$.pipe(map(props => ({
      foo: props.bar,
    })));
  }),

with frintJs map,

map(props => ({ foo: props.bar }))

However, the only way to do it now without rxJs map, is to use a combination of withDefault and map functions of frintJs.