Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call process.nextTick if it's defined #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvanalst
Copy link

Adding this check allows the library to be used outside of node.js.

This is very useful for me, because I'd like to try and use step.js on a front end application to help keep my code as clean as possible.

@trungpham
Copy link

it would be cool if we can use step in the browser instead of async, which is a bit bloated for what it is trying to do.

@aeosynth
Copy link

aeosynth commented Sep 9, 2012

setTimeout works in node; you can be really lazy by skipping the check and just replacing process.nextTick.

@bminer
Copy link

bminer commented Nov 14, 2012

@aeosynth - Agreed. Just replace process.nextTick with setTimeout(..., 0) altogether. Optionally, add a comment to the code for clarity.

@boomla
Copy link

boomla commented Apr 24, 2013

process.nextTick once gave me an over 10x speed increase. I would never ever even consider using setTimeout again - except in the browser of course.

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.

6 participants