-
-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
Description
This is meant to be an alternative to modifiers (#353). Also this is a bit a vague idea I just had, and I would love some feedback. If some people like it I will try my best and try to write an RFC for this.
Basically why don't we just introduce rendering events like normal DOM events?
<button DidInsertElement={{action 'didInsertButton'}} WillDestroyElement={{action 'willDestroyButton'}}>Save</button>
This would be very straightforward to teach to everyone who understands closure actions!
The didInsertButton
and willDestroyButton
actions would receive a synthesized event
property as single argument with a target
property pointing to the DOM node.
For this example I've used uppercase event names to distinguish from normal events:
<button onclick={{action 'save'}} DidInsertElement={{action 'didInsertButton'}} WillDestroyElement={{action 'willDestroyButton'}}>Save</button>
However maybe we should use the @
sign, because in some ways its simmilar to the difference between arguments and attributes:
<button onclick={{action 'save'}} @didInsertElement={{action 'didInsertButton'}} @willDestroyElement={{action 'willDestroyButton'}}>Save</button>
Metadata
Metadata
Assignees
Labels
No labels