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

Tidy up overrides and add watch API #227

Merged
merged 8 commits into from
Jan 30, 2019
Merged

Conversation

LukeSheard
Copy link
Contributor

@LukeSheard LukeSheard commented Jan 22, 2019

Following reading #89 I thought I'd PR two things:

  1. Tidy up some of the overrides to make it neater
  2. Add a watch API which watches all the filesystems. I do this by returning a proxy object around the FS.FSWatcher which calls all the watchers we get back from the underlying filesystems.

Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks great, just added two small requests.

Also, are there any breaking changes in this PR? (I guess the behaviour of watch() changes.)

src/__tests__/union.test.ts Outdated Show resolved Hide resolved
src/union.ts Show resolved Hide resolved
src/union.ts Outdated Show resolved Hide resolved
@LukeSheard
Copy link
Contributor Author

LukeSheard commented Jan 23, 2019

I've done the changes you asked for. There's no breaking changes AFAIK here, just a what I would call a "fix" for #89 to support watch.

EDIT: I actually was reading https://nodejs.org/docs/latest/api/fs.html#fs_fs_unwatchfile_filename_listener and now added a method which throws an error when that is called - since we don't track watchers to be able to call watcher.stop() and the original implementation doesn't work anyway. So I would call this a breaking change.

@LukeSheard
Copy link
Contributor Author

Realized my mistake in my latest push that broke the build in switching to Set.

This should be good to merge now.

Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@streamich streamich merged commit 6b9a3f2 into streamich:master Jan 30, 2019
@wood1986
Copy link

wood1986 commented Oct 2, 2021

@LukeSheard Did you test if it throws an exception when an invalid is provided
See streamich/memfs#859

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.

3 participants