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

Async method calling a dependency synchronously? #1

Closed
nelsonic opened this issue Mar 21, 2015 · 2 comments
Closed

Async method calling a dependency synchronously? #1

nelsonic opened this issue Mar 21, 2015 · 2 comments
Labels

Comments

@nelsonic
Copy link

Hi @jonschlinkert, hope you are well.

While trying out this module, we noticed that you are calling your is-directory module's isDir method (without a callback) in the dirs (async) method on line 31:

dirs/index.js

Line 31 in c90b488

if (isDir(filepath)) {

am I missing something...?
Thanks!

nelsonic added a commit to nelsonic/practice that referenced this issue Mar 21, 2015
@jonschlinkert
Copy link
Owner

nope you're right. initially is-directory was sync only: jonschlinkert/is-directory@8989e5e. Looks like I did both on the same day and forgot to circle back to this lib to update for async.

thanks for the heads up!

@jonschlinkert
Copy link
Owner

actually, yes, I forgot about this until I pulled it down:

dirs/index.js

Lines 14 to 16 in c90b488

if (typeof cb !== 'function') {
return dirs.sync(dir);
}
.

If no callback is passed, it calls the sync function. closing this since it's not a bug here. but, it's arguably not a good idea since we both missed it. which would make it an issue on the other lib. thanks for the feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants