srcrip / live_toast

A beautiful drop-in replacement for the Phoenix Flash system.
https://toast.src.rip
MIT License
193 stars 17 forks source link

README example is incorrect #3

Closed brainlid closed 6 months ago

brainlid commented 6 months ago

The following code example from the README's "configuration" section is incorrect:

<LiveToast.toast_group flash={@flash} connected={assigns[:socket] != nil} toast_class_fn={MyModule.toast_class_fn/1} />

I'm embarrassed to say it took me longer than it should have to find the issue. Corrected version:

<LiveToast.toast_group flash={@flash} connected={assigns[:socket] != nil} toast_class_fn={&MyModule.toast_class_fn/1} />

It is missing the & on the toast_class_fn. The error it was giving me was throwing me off.

srcrip commented 6 months ago

Thank you Mark, sorry about that!

srcrip commented 6 months ago

Fixed in: https://github.com/srcrip/live_toast/commit/67f7c5b03240ce5c09b4fbeffb3b096c5adc2217 and new docs deployed