question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different behaviour when use `actions.add()` and `toastr.success()`

See original GitHub issue

The problem: When I use actions instead of regular toastr I can’t use default options which automatically added here https://github.com/diegoddox/react-redux-toastr/blob/master/src/toastrEmitter.js#L5 https://github.com/diegoddox/react-redux-toastr/blob/master/src/utils.js#L65

and in this case I lost some features like creating timeout again when mouse leave here https://github.com/diegoddox/react-redux-toastr/blob/master/src/ToastrBox.js#L112-L122

you may notice that when I use actions.add() I have to set all defaults myself because function add just forwards payload to action https://github.com/diegoddox/react-redux-toastr/blob/master/src/actions.js#L25

As a result I can’t use any of default options on actions.

So I’d suggest you to add some function which add default values for it before forward it to action creator.

here is an example I used for demo

image

demo

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
diegoddoxcommented, Mar 9, 2018

Hi @frankrod I didn’t have the time to fix yet

0reactions
diegoddoxcommented, Dec 10, 2021

do it to inactivity, will close.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I implement Toastr JS? - Stack Overflow
If you want to provide a title on the toastr message, just add a second argument: // for info - blue box toastr.success('The...
Read more >
react-redux-toastr - npm
The toastr method use eventemitter3 to dispatch the actions ... If not provided we will add one. type: 'success', title: 'your title', ...
Read more >
Using Toastr - CodePen
How to use Toastr. Popup Type. Toastr have 4 popup type and the different is icon and background. Success Info Error
Read more >
How to add Toastr in your angular project just in 15 minutes?
Demo - Step 1 - Install dependancies for toastr and animation in your project. ... showToaster() { this.toastr.success('Hello world!
Read more >
lightning-record-edit-form - Salesforce Developers
To understand the different use cases, see Work with Records Using Base Components. ... preventDefault() to cancel the default behavior of the event....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found