Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: support clear after #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ken-kost
Copy link

Option clear_after, an integer representing milliseconds when to :clear_flash on self()

@@ -29,6 +29,12 @@ defmodule LiveToast.LiveComponent do
# If there was, we need to look for a corresponding flash message (with the same kind and message) and remove it.
sync_toasts = Map.get(assigns, :toasts_sync, [])

clear_after = Map.get(assigns, :clear_after)

unless is_nil(clear_after) do
Copy link
Author

@ken-kost ken-kost Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote if not and Styler made it unless. In newer version unless is deprecated: OTP Update and Deprecating Unless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant