kube / monolite

Statically-typed structural-sharing tree modifier
https://www.npmjs.com/package/monolite
148 stars 6 forks source link

Babel plugin: nested set not transformed #40

Open kube opened 6 years ago

kube commented 6 years ago

Nested set expressions are not transformed by the Babel Plugin:

set(
  state,
  _ => _.nested.collection,
  arr => arr.map(item =>
    set(item, _ => _.nested.prop, x => x + 1)
  )
)

After compilation it results in:

set(
  state,
  ['nested', 'collection'], // TRANSFORMED
  arr => arr.map(item =>
    set(item, _ => _.nested.prop, x => x + 1) // UNTOUCHED
  )
)