toasty icon indicating copy to clipboard operation
toasty copied to clipboard

Implement conditional toasts. Closes #9

Open malinoff opened this issue 6 years ago • 3 comments

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 avatar May 21 '19 05:05 malinoff

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 avatar May 21 '19 05:05 malinoff

@pablen could you please take a look?

malinoff avatar May 26 '19 08:05 malinoff

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

icidasset avatar May 05 '20 14:05 icidasset