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

Individual watchers have different construction API from index.js entry point #40

Open
DavidSouther opened this issue Jan 9, 2015 · 3 comments

Comments

@DavidSouther
Copy link

The individual watchers NodeWatcher PollWatcher etc expect to be used with the new operator. The sane function on does that, but switching from var watch = require('sane'); to var watch = require('sane').NodeWatcher; is not a valid transformation. Can the Watcher ctors be made to instantiate themselves, if ! this instanceof Watcher?

@amasad
Copy link
Owner

amasad commented Jan 9, 2015

I'm not against it if you want to send a PR. Otherwise could easily be:

function watch(dir, options) {
  return new NodeWatcher(dir, options);
}

@DavidSouther
Copy link
Author

This came up in a refactor (the one mentioned above) and was unexpected

@amasad
Copy link
Owner

amasad commented Jan 9, 2015

right, maybe I should keep a changelog or the like.

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

No branches or pull requests

2 participants