canjs / can-stache

Live binding handlebars templates
https://canjs.com/doc/can-stache.html
MIT License
10 stars 13 forks source link

Support object literals, shorthand assignment, spread and rest-ish operators #505

Open justinbmeyer opened 6 years ago

justinbmeyer commented 6 years ago

This will work in call expressions and stache bindings:

This was discussed on a recent live stream (15:48).

Object literals:

{{ foo( {propA: valA, propB: valB} ) }}
<sub-component state:from="{propA: valA, probB: valB}">

shorthand assignment

{{ foo( {propA} ) }}
<sub-component state:from="{propA}">

Spread

{{ foo( {propA, ...z } ) }}
<sub-component state:from="{propA, ...z}">

Rest-ish:

<sub-component this:assignFrom="value"/>
<sub-component this:assignFrom="{propA, propB}"/>
matthewp commented 6 years ago

A client brought up wanting spread.