YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.71k stars 51 forks source link

Local sync? #46

Closed echarles closed 2 years ago

echarles commented 2 years ago

Is it possible to use SyncedStore without one of the Y.js providers ?

I wonder if SyncedStore could be used like any other state library (redux, mobx...) and only upgrade/configure it once you really need collaboration?

YousefED commented 2 years ago

Hi Eric!

Can you specify more what functionality you’re looking for exactly (what’s the functionality you’d like to “keep”?).

It should be possible to use syncedstore, and just not connect any sync provider.

Alternatively, perhaps the Reactive library could provide what you’re looking for?

https://github.com/YousefED/reactive

On Sun, 23 Jan 2022 at 20:20, Eric Charles @.***> wrote:

Is it possible to use SyncedStore without one of the Y.js providers ?

I wonder if SyncedStore could be used like any other state library (redux, mobx...) and only upgrade/configure it once you really need collaboration?

— Reply to this email directly, view it on GitHub https://github.com/YousefED/SyncedStore/issues/46, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC2BWNOQLI6BDKYFRDWR3TUXRIHLANCNFSM5MTWWOIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

echarles commented 2 years ago

Can you specify more what functionality you’re looking for exactly (what’s the functionality you’d like to “keep”?).

Just a local sync without depending on a y.js provider (so no webrtc, no websocket, no indexdb...). I guess it should be possible to go throught the Y.Doc in memory and just update the store via that local Y.Doc.

It should be possible to use syncedstore, and just not connect any sync provider.

Yes, but for non-syncing appliation, using a sync provider could not be mandatory. I have looked for a "in-memory" sync provider, but did not find any. Even if such a in-memory would exist, I guess it would create a data structure that would not be needed in case of local (non-syncing) state.

Alternatively, perhaps the Reactive library could provide what you’relooking for? https://github.com/YousefED/reactive

Yes, I have looked at that and have opened a question on https://github.com/YousefED/reactive/issues/5 because I don't see how to use it from different React components.

YousefED commented 2 years ago

Yes, but for non-syncing appliation, using a sync provider could not be mandatory.

A sync provider is not mandatory for SyncedStore, just like it's not mandatory for Yjs. If you just create a Y.Doc, everything will work in memory. Only if you want to persist data or enable collaboration, you'll need a sync provider.

Hope this makes sense! I'll close this issue for now, but feel free to reply with additional questions

echarles commented 2 years ago

Makes sense! Thx @YousefED