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

Is there any reason why this can't be used on the frontend? #310

Open
carcigenicate opened this issue Jul 11, 2023 · 4 comments
Open

Is there any reason why this can't be used on the frontend? #310

carcigenicate opened this issue Jul 11, 2023 · 4 comments

Comments

@carcigenicate
Copy link

carcigenicate commented Jul 11, 2023

We're using this on our backend, but ran into a simple case where it would be very handy to use on the frontend. I can't find any mention of why this wouldn't be advisable to use on the frontend.

I've tried it for the case we need it for, and it works exactly as I'd expect. I also read through the source and can't find any reason why this would be problematic. It require Node's events, but there's a fill for that for browsers that it uses.

An official response would be nice though since I can't find anything via Google. I'm just asking because "Node" is literally in the name, which suggests that it has some dependency on Node.

Thank you

@Freedzio
Copy link

what frontend are you using?

@carcigenicate
Copy link
Author

Angular, but I'm asking from a generic point of view. I don't think this should depend on the frontend framework in theory, which is why I didn't add it to the question.

I've actually decided not to use it for my use-case now, but if I was searching for this, others certainly are too. An authoritative issue would make for a good Google result.

@doc-han
Copy link

doc-han commented Aug 7, 2023

This library makes use of the node events Emitter so you should have no problems if you have a great polyfill for it.

Note: I don't see a need to use this for the frontend as that will mean you're providing a caching layer per person on their machine which already exists as HTTP Caching or just use the localstorage

@bfontaine
Copy link

Have you tried using localStorage/sessionStorage?

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

4 participants