Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

ready function on package #5

Open
amelon opened this issue Jul 19, 2012 · 1 comment
Open

ready function on package #5

amelon opened this issue Jul 19, 2012 · 1 comment
Assignees

Comments

@amelon
Copy link
Contributor

amelon commented Jul 19, 2012

Hi,

as include and require use a deferred execution to build path, it would be usefull (at least for test) to have a ready function to ensure package is ready to answer correctly.

Using mocha I've done following "trick"

function waitPathReady(package, done) {
  if (package.paths.length) return done();
  console.log('nb_waits', ++nb_waits);
  setTimeout(function() {waitPathReady(package, done)}, 5);
}

Or maybe, package should answer once it is ready?

@chrisjpowers
Copy link
Owner

I ran into the same problem when I was building the command line tool -- I wanted to use the package once it's ready, but didn't have a good way of doing it. I like the idea of a ready callback, I'll work on that.

@ghost ghost assigned chrisjpowers Aug 5, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants