arlac77 / svelte-websocket-store

svelte store with a websocket backend
BSD 2-Clause "Simplified" License
286 stars 21 forks source link

What would be some common use cases for this library? #468

Open newlegendmedia opened 2 years ago

newlegendmedia commented 2 years ago

I am wondering what this was developed for. Does it help with refreshing data instead of polling for example? Thanks!

lancedouglas1 commented 2 years ago

TL;DR: apps that are purely data driven in realtime. The socket is the channel for live data, the screen components are layout structures for presentation and action-capture only.

I think the most promising use case is flux or 3factor architectures for smart applications where the dynamic information to the screen is based on user, system, global, etc contexts.

I build apps in the asset management and reservations industries. Those apps are like stock-markets and are exposing stateful options for highly contentious user actions. The websocket store lets me avoid polling, sure, but it actually allows me to push changes to reality is a separate channel than the views' request channels. This becomes extremely powerful when a single user may have multiple live contexts into the data and actions (e.g. on multiple devices, IoT controlled/monitored components to their overall experience, 3rd parties sharing their experience in multi-user interfaces)

The neatest story about the use case is from facebook's impetus to create the flux architecture: buggy notifications. https://facebook.github.io/flux/docs/in-depth-overview

3factor: https://3factor.app/

newlegendmedia commented 2 years ago

I appreciate the overview of these use cases. Being fairly new to Svelte, I’m encouraged to see it being used in some pretty advanced scenarios like these. Cheers!

On Dec 4, 2021, at 3:31 PM, lancedouglas1 @.***> wrote:

TL;DR: apps that are purely data driven in realtime. The socket is the channel for live data, the screen components are layout structures for presentation and action-capture only.

I think the most promising use case is flux or 3factor architectures for smart applications where the dynamic information to the screen is based on user, system, global, etc contexts.

I build apps in the asset management and reservations industries. Those apps are like stock-markets and are exposing stateful options for highly contentious user actions. The websocket store lets me avoid polling, sure, but it actually allows me to push changes to reality is a separate channel than the views' request channels. This becomes extremely powerful when a single user may have multiple live contexts into the data and actions (e.g. on multiple devices, IoT controlled/monitored components to their overall experience, 3rd parties sharing their experience in multi-user interfaces)

The neatest story about the use case is from facebook's impetus to create the flux architecture: buggy notifications. https://facebook.github.io/flux/docs/in-depth-overview https://facebook.github.io/flux/docs/in-depth-overview 3factor: https://3factor.app/ https://3factor.app/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arlac77/svelte-websocket-store/issues/468#issuecomment-986095889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAED62BIE4YMEVWOZJHSR5LUPKCCHANCNFSM5JHSP3SA.

ta3pks commented 2 years ago

I still don't understand the use tho. Does this require some specialized back end that spits out a specific form of data? I just have a hard time understanding the relationship between generic app events and a store that is supposed to store specific data for access