Skip to content

Improve clear#219

Open
ahgittin wants to merge 2 commits into
Foxandxss:masterfrom
ahgittin:improve-clear
Open

Improve clear#219
ahgittin wants to merge 2 commits into
Foxandxss:masterfrom
ahgittin:improve-clear

Conversation

@ahgittin

Copy link
Copy Markdown

As per discussion at #137:

  • Sometimes clear(toast) doesn't immediately clear
  • People expect clear([toast]) should work for a list arg [toast]

This fixes both issues.

since the usage of `clear([toast])` as optional syntax is confusing to people
seems the destroy call is not always immediate
@ahgittin

ahgittin commented Feb 9, 2017

Copy link
Copy Markdown
Author

Hi @Foxandxss -- anything I can do to encourage you to merge this? thx!

@Foxandxss

Copy link
Copy Markdown
Owner

I just need time to think, that is a breaking change which forces me a new major version.

@ahgittin

ahgittin commented Feb 9, 2017

Copy link
Copy Markdown
Author

@Foxandxss I don't think it breaks the API -- just expands it to accept clear(list) in addition to clear(toast) and clear() which both still work as before.

and the contract of remove should be that the toast is immediately gone, from the user's perspective. if the destroy is immediate it is no-op, but in cases where the event handler delays the destroy (until other toasts finish for some reason i couldn't figure out) setting the element's html to "" means it is apparently gone until the handler catches up.

LMK if i can help at all. thx.

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.

2 participants