Closed victorzhangyf closed 4 years ago
I think pref
is designed to be used inside an array right now. pref
can generate multiple items: pref({a:1})
is equivalent to [{a: 1},{a: 4}]
and [{a: 1},{a: -2}]
. The generated items can all be appended to the enclosing array. act [pref({a: 1})]
behaves as expected.
It is a bit tricky to also support pref
outside an array, since sometimes we would need to append the generated items to the enclosing array, and sometimes we need to create a new array.
Got it, makes sense! Thanks!
It appears
act pref({a: 1})
compiles toCould you look into that?
Thank you!