API is not enough flexible
Closed this issue · 5 comments
API could be more flexible in terms of README.md example:
odoo.default({ el: '.js-odoo', value: '£42,000,000' });
odoo
could just return newly created node with SVG instead of mounting it directly to global DOM, so you could use it for example in node.js env.
Also, there could be an additional helper to preserve previous functionality.
example
const text = odoo.default({value: '£42,000,000'});
document.querySelector('.js-odoo').appendChild(text);
Yes. I also consider moving to rollup + babel and get rid of this strange default property (umd)
It is quite hard to achieve that without web components lifecycle methods. I am closing now until moved library to webcomponent world or figured out how to control node the other way.
Could you point me to the similar API you have seen to give me a better clue?
@coderitual sorry, I can not. Every API I've seen recently does not support such approach.
When you mentioned about issues with lifecycle methods etc, I understood that this is not possible to follow this way unless custom element is introduced.
Ok, closing then. Thanks for the input!