Skip to content

Implement conditional toasts. Closes #9#11

Open
malinoff wants to merge 2 commits into
pablen:masterfrom
malinoff:conditional-toasts
Open

Implement conditional toasts. Closes #9#11
malinoff wants to merge 2 commits into
pablen:masterfrom
malinoff:conditional-toasts

Conversation

@malinoff

@malinoff malinoff commented May 21, 2019

Copy link
Copy Markdown

Hi, thanks for the awesome library!

Instead of giving the ability to remove toasts on demand, I have thought about checking for a user-provided predicate. This way does not expose any implementation details (including ids) and is fairly flexible.

The given predicate is checked every check number of milliseconds and can be closed manually (this stops checking process).

@malinoff

malinoff commented May 21, 2019

Copy link
Copy Markdown
Author

By the way, it's now possible to remove the RemoveBehaviour type.
Temporary becomes \m -> False, Persistent becomes \m -> True.

The downside of that is that there will be lots of CheckCondition messages generated for persistent toasts. I'm not sure if that is a real problem though.

The commit below showcases the above. Feel free to revert it before merging if you'd like to keep the type.

@malinoff

Copy link
Copy Markdown
Author

@pablen could you please take a look?

@icidasset

Copy link
Copy Markdown

@pablen I would love to see this added as well. Only thing I'm missing from this great library. Can help if needed.

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