Common event 'change' for handle if input value prop is changed by plugin
7iomka opened this issue · 3 comments
7iomka commented
Hi.
I need to update my local variables when input value changed.
Currently I needed this stuff:
const inputValues = null;
tagifyInstance.on('add', onUpdateTagify);
tagifyInstance.on('remove', onUpdateTagify);
tagifyInstance.on('edit:updated', onUpdateTagify);
function onUpdateTagify(e) {
inputValues = e.detail.value;
}
Proposal:
tagifyInstance.on('change', onUpdateTagify);
Multiple plugins making some common used events along with specific events - this is best practice.
For example: onBeforeUpdate, onUpdate, onAfterUpdate. (update is common, before/after - specific)
yairEO commented
7iomka commented
Maybe 'value-change' event. I mean just to use single event that fire every time if value of input has modified(updated) from other internal / api methods/events.
yairEO commented
v3.2.0
now allows listening to multiple events with a space between them:
tagifyInstance.on('add remove edit:updated', onUpdateTagify)