-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use with Maps and Sets #1
Comments
+1 this question |
oh yeah, it won't work. I will add support for them in milestones 0.9.6. |
I'm trying to put together something for this... |
Dumb question, but when you're referring to "Sets" in javascript, you're talking about associative arrays, correct? |
Also, what do you guys think of a method signature like this?
|
@johndevor that's a good question. We should definitely support a Map because MobX has it's observable counterpart implemented already. In regards to the the type- we can easily recognize it from the default value so there's no need for programmer to hint the type via en extra parameter. |
How do you recognize the difference between an obj and a map in these cases? storedObservable('text', {'myObjKey':1}, 500) storedObservable('text', {'myMapKey':1}, 500) Both of the default values appear to be similar objects to me. Unless you had in mind changing the method signature entirely to something like:
|
@johndevor I was thinking more like: const defaultMap = new Map()
defaultMap.set('myMapKey', 1)
storedObservable('text', defaultMap, 500) |
Ah yes of course. 👍
…On Thu, Mar 30, 2017, 11:35 AM Jiri Spac ***@***.***> wrote:
@johndevor <https://github.com/johndevor> I was thinking more like:
const defaultMap = new Map()defaultMap.set('myMapKey', 1)storedObservable('text', defaultMap, 500)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEoM5vEsbRl0UlxtRnZTvoEumOWGOKhks5rq8vXgaJpZM4MRBw0>
.
|
Haven't had time to get to this if anybody wants to take a stab at it... |
Can this library be used with JavaScript Maps and Sets? I'm not having any luck adding values to a Set used in the store.
The text was updated successfully, but these errors were encountered: