mikeal / gza

Functional custom HTML elements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: promise API for properties.

mikeal opened this issue · comments

let init = async (element) => {
  let value = await element.waitFor('propertyName')
}
gza`
${init}
<my-element>
  <span>${ async (settings) => setttings.waitFor('propertyName') }</span>
</my-element>
`

This would allow users to effectively block initialization and/or rendering until specific required properties are set.

This is pretty important for cases where complex objects must be set as properties for the an element to function. This opens up the possibility for those properties to be set at any time but still normalize into a linear render path.

i think this would be fantastic; when used with lazy datum decoration it is very powerful.

This is in, it was implemented in rza and the latest dep taken.