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.

Open to improvements around setimmediate?

See original GitHub issue

I’m new to the project so please forgive me if some history has shown why we use global.setImmediate to pull in what I would otherwise assume comes from npm install setimmediate

https://github.com/rt2zz/redux-persist/blob/master/src/defaults/asyncLocalStorage.js#L1

Is it possible we could use an ES6 import here or will this always be a global lookup (when undefined)?

A little background: I’m currently working to add redux-offline and thus redux-persist support for emberJS developers and the very last blocker is this line so I’m curious what I can do to learn more about it /and possibly unblock it by using an ES6 import of some kind (if possible).

Thank you in advance!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rt2zzcommented, Apr 18, 2017

great, I will still mull over these potential changes but maybe with a little less urgency 😄

1reaction
toranbcommented, Apr 18, 2017

@rt2zz I’ve been able to work around this (to avoid the global hack mentioned above). So for now I’d say “ignore me” and I’ll do my best to learn more about react native/ other (non ember) envs that the community is using this great library in 😃

If you still want to hash out the change above I’m all ears - curious if others would find that useful

Read more comments on GitHub >

github_iconTop Results From Across the Web

In Node.js, setImmediate() callbacks get executed on current ...
If you run the above code whatever is in process.nextTick function will get executed first. The reason is, it runs before event loop...
Read more >
setImmediate is not always very immediate #5798 - GitHub
The differentiating factor for setImmediate is that we're always yielding to the loop to let it do IO. Yes, that means that cb...
Read more >
Setimmediate NPM | npm.io
setImmediate allows scripts to yield to the browser, executing a given operation asynchronously, in a manner that is typically more efficient and consumes...
Read more >
implementation: setImmediate API - Bugzilla@Mozilla
I think there is a bug open to make event loop access OS level stuff less often, at least on OSX. ... This...
Read more >
A few tips to improve Nodejs performance - Medium
Most of the points are centered around the event loop(Reactor pattern) only as ... Use setImmediate whenever possible for such use cases.
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