Closed c0ldfront closed 6 years ago
Hi, current implementation expects an array
in the Dictionary constructor: Array<IKeyValue<TKey, TValue>>
I think you are right, a pure object-based constructor will be really nice feature to have.
I'll work on it, thanks a lot for the feedback 👍
Hi, I just created/pushed the new function Dictionary.fromJsObject<TValue>(object: any)
Please tell me if it fits your requirements, thanks 😄
Wow isc30! Thanks for such a fast response on this matter! Yeah it works perfectly, I just tested it and works perfectly. I am using it like so.
var categories_record: IDictionary<string, Category> = Dictionary.fromJsObject<Category>(event[2]);
Thanks again for responding and creating a new function so quickly.:)
Nice to hear! 🎉 Thanks to you for feedback and support on the library 😄
Hi,
I am trying to use your library with Google Firebase Realtime Database JavaScript objects. I am having an issue well trying to create a new Dictionary<string, Object> which doesn't seem to be working well with JavaScript objects. The object I am trying to parse looks like this.
I was stepping into the code to try and figure out what was the issue, because I am pretty new in JavaScript and noticed. in the Collections.js compiled version It is trying to find the length of the keyValuePairs.length which doesn't seem to work with JavaScriptObjects? If i do Object.keys(keyValuePairs).length it will find the correct length for the total amount of keys within that object.
Am I using dictionaries worry or is there anyway I can use your current linq-collection with javascript objects and or is there a way I can fix this issue so I can use linq-collection?
Thanks for your help.