-
-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Description
Would there be any interest in moving the current flash logic from the flash-message component, into a modifier?
Thinking it could be (somewhat) backwards compatible, the current flash-message component would end up looking like this;
// flash-message.hbs
<div
...attributes
{{flash-modifier @flash}} // applies all the classes, attributes, event handlers, flash logic. The component JS would be mostly empty.
>
{{#if hasBlock}}
{{yield this @flash (action "onClose")}}
{{else}}
{{@flash.message}}
<FlashMessage::Progress @showProgress={{this.showProgressBar}} @duration={{this.progressDuration}} />
{{/if}}
</div>It would also allow users of this addon to make custom flash components with relative ease if they wish to do so, without having to implement all of the logic from the flash message component.
{{#each flashMessages.queue as |flash|}}
<my-flash class="abc" {{flash-modifier flash}}>
wow, that's all I have to do, don't even need a component
</my-flash>
{{/each}}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels