#Stream Progress Updates with Remix using Defer, Suspense, and Server Sent Events

1 messages · Page 1 of 1 (latest)

fleet nacelle
worn tapir
#

Just pondering/dreaming/ideating, could this also be used in action data when uploading files to a database?

So you can get streaming progress of a file upload to the db?

fleet nacelle
#

Your action need to write the progress somewhere, and then you can use an event stream resource route to stream that progress back to any page that wants to read it

#

the action cannot stream progress back itself though

#

In this example I write to the filesystem via JSON but you could more easily write it to a DB like sqlite

worn tapir
#

Interesting. Mind is racing now haha. Thanks!

shrewd flicker
#

That’s awesome

halcyon storm
#

Very cool!

Nit: your item.$hash.tsx has a setInterval with no second argument

frank sorrel
#

nice! very creative & practical use of SSEs!