#I tried to implement sse but it doesn't work. What is the reason?

1 messages · Page 1 of 1 (latest)

molten dirge
#

do you see the connection on the browser console?

#

what's most likely happening is that you need to keep the instance of emitter on globalThis to ensure it's not re-created between reloads

#
bold tendon
molten dirge
#
export let emitter = remember("emitter", () => new EventEmitter())
#

the first argument of remember is a string, it can be anything as far as you're not repeating it with another remember call

bold tendon
molten dirge
bold tendon
#

This? And what can do with this npm?

I really don't understand, if you don't mind, can you show me an example based on the code in my post?

molten dirge
#

copy that in a file inside your app, uninstall the package from npm, use the code you copied the same way I showed before, just import from the local file instead of the package

bold tendon