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

Consistent way to check if stream is MemoryStream #304

Open
wclr opened this issue Jun 29, 2020 · 2 comments
Open

Consistent way to check if stream is MemoryStream #304

wclr opened this issue Jun 29, 2020 · 2 comments

Comments

@wclr
Copy link
Contributor

wclr commented Jun 29, 2020

There is two methods I believe available now:

Check if instance of MemoryStream, not always applicable, as there may be problems with nested modules.
Check if the object has property _has present, but it is just a hacky way.

Probably need to add a more consistent method that will be officially exposed.

@staltz
Copy link
Owner

staltz commented Jun 29, 2020

I'm open to doing this (probably exposing a nice method that internally utilizes _has or something like that), but I'm curious what's your surrounding use case for this? I haven't done this check myself yet.

@wclr
Copy link
Contributor Author

wclr commented Jun 29, 2020

I'm implementing HMR for cyclejs components, so there I replicate (create proxy) streams and need to know if to create with memory or not.

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