-
Notifications
You must be signed in to change notification settings - Fork 519
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
Strongly typing a SharedMap #8520
Comments
@ChumpChief @skylerjokiel I think we've investigated this in the past, but I don't know where we landed. Thoughts? |
If you want to hear from a customer about why typing is important, please let me know. Same reason we use typescript instead of Javascript. |
@kevindiclemente Are you always storing the same type of object in the map? Today SharedMaps can store values of heterogeneous types, so I'm wondering if you're using that capability, or foresee needing it. |
Even if the consumer plans to store multiple types, the SharedMap could still be typed in such a way as to clearly determine which types are expected. TypeScript doesn't have to force a single type. In most cases, the type could default to The lack of proper types has been one of the first difficult aspects of onboarding to Fluid Framework that I encountered. It's not consistent with what I would expect from a client-side library in this regard. I ended up writing my own wrapper classes around the DDS types to add better type handling. |
This issue has been automatically marked as stale because it has had no activity for 180 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework! |
Feature
Is your feature request related to a problem? Please describe.
It's not currently clear how to add strong typing to SharedMap. Such as
key: string -> SharedCell<number>
Describe the solution you'd like
Declare a
SharedMap
using generics, like withSharedCell
; whereSharedCell<string>
we could haveSharedMap<string, string>
Existing work
Not aware of it
Describe alternatives you've considered
Having weak typing, which is error prone, or adding a wrapper class around SharedMap.
Additional context
The text was updated successfully, but these errors were encountered: