merkle-open / gondel

🚡 Gondel is a tiny library to bootstrap frontend components
https://gondel.js.org
MIT License
36 stars 10 forks source link

Generic DOM utils parameters #17

Closed janbiasi closed 6 years ago

janbiasi commented 6 years ago
jantimon commented 6 years ago

Cool 👍- one last question is it still possible to call getComponentByDomNode(node) without setting the generic? and if yes will the result be of type GondelComponent?

janbiasi commented 6 years ago

Is it still possible to call getComponentByDomNode(node) without setting the generic? and if yes will the result be of type GondelComponent?

Yes for sure it is! That's the default behaviour, short example:

// button is of type 'GondelComponent'
const a = getComponentByDomNode(buttonNode);

// button is of type 'Button'
const b = getComponentByDomNode<Button>(buttonNode);

Sidenote: I didn't see any documentation regarding the dom-utils, I think we should expand the documentation in the next steps for better usability.

jantimon commented 6 years ago

Merged in #18 👍