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

[Q] how should I map internal objects to SyncedStore proxies? #129

Open
rozek opened this issue Jun 25, 2024 · 0 comments
Open

[Q] how should I map internal objects to SyncedStore proxies? #129

rozek opened this issue Jun 25, 2024 · 0 comments

Comments

@rozek
Copy link

rozek commented Jun 25, 2024

Hi!

I'm currently evaluating "SyncedStore", but ran into a problem:

  • my items to share are class instances or lists (i.e., arrays) or them
  • however, adding objects to a "SyncedStore" constructs Y.Map/Arrays and then proxies them
  • as a consequence, the "target" property of any change reported by "observeDeep" returns something completely different from the proxy or my original object

As I would like to register a single change event handler (i.e., a toplevel "observeDeep") and access the changed object directly, the question arises how I can determine which of my original objects maps to a given change.target

I already tried to use the UUID of my original object, but setting a property on an array raises an exception in "array.ts":

array.ts:173 Uncaught Error
    at Object.set (array.ts:173:15)
    at VM30368 about:srcdoc:11:48
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

1 participant