You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I pass a rendered React elements as messages. As they are objects, they are never equal, so preventDuplicates feature does not work for me.
So, how about introducing a new prop, which will accept a comparator function? It will allow for everyone to implement any specific logic he needs, and will require a very few changes.
Also: you import entire Lodash and only use _.includes. Lodash is huge, it's a horrible dependency.
You can instead do import includes from "lodash/includes", it will save a LOT of bytes. Or just check messageList.indexOf(message) – actually, this is the only thing needed here, isn't it?
The text was updated successfully, but these errors were encountered:
You make some good points. I agree that Lodash can be replaced with a lighter implementation. I would strongly recommend you to fork toastr and create a pull request incorporating these changes. Please advise. Cheers!
I pass a rendered React elements as messages. As they are objects, they are never equal, so
preventDuplicates
feature does not work for me.So, how about introducing a new prop, which will accept a comparator function? It will allow for everyone to implement any specific logic he needs, and will require a very few changes.
Also: you import entire Lodash and only use
_.includes
. Lodash is huge, it's a horrible dependency.You can instead do
import includes from "lodash/includes"
, it will save a LOT of bytes. Or just checkmessageList.indexOf(message)
– actually, this is the only thing needed here, isn't it?The text was updated successfully, but these errors were encountered: