thoth-org / Thoth.Elmish.Toast

https://thoth-org.gitbook.io/thoth-elmish-toast/
MIT License
6 stars 4 forks source link

Expose the dispatch function #4

Open alfonsogarciacaro opened 5 years ago

alfonsogarciacaro commented 5 years ago

Because the toast is created as an Elmish command, it'd be useful to expose the dispatch function. For example, Elmish.Toastr allows you to send Elmish messages in the click event. Exposing dispatch would be more flexible if the user has a custom renderer and wants to display several buttons.

MangelMaxime commented 5 years ago

I tried that in the past couldn't find a clean way to support this. Because the dispatch. you have access to in the Cmd is the one from the subcomponent.

alfonsogarciacaro commented 5 years ago

That's what I would expect :)

MangelMaxime commented 5 years ago

The previous implementation is still in the code but not documented ^^.

If you want to try it:

I don't remember if this works or no. Or if there is more to add for making the view correct.