You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently making use of the sync-r method in matchbox.reagent to connect my reagent app with firebase with ease. I noticed that the elements in the r/atom returned by sync-r are not in the right order. I expect them to be in the same order as they are found in firebase.
In my app, I make use of conj! to get firebase to generate keys. What's great about this is that firebase offers some guaranties about the order of items when using .push() (or conj! in this case). I was hoping to be able to leverage those guaranties.
My guess is that I'm having this issue because sync-r returns a map which has no guaranties about order. Would it be possible to get an alternative to sync-r that returns a sorted-map instead of a regular map?
I should mention that I am aware of sync-list and from what I can tell it does respect ordering. My issue with it is that it doesn't give me access to the key of each element.
The text was updated successfully, but these errors were encountered:
Hey @dotboris - your desire is a totally reasonable one. Would accept a PR to switch to sorted-map, doubt there's significant overhead compared to going immutable.
Ping @dotboris - is this still a bother? Thinking of just making sorted maps the default at the mapping layer when "immutalising" data snapshots. And this could be backed out of using a mechanism like discussed in #51.
Have a bit of time to spend on OSS this evening, so let me know if you would find this valuable.
I'm currently making use of the
sync-r
method inmatchbox.reagent
to connect my reagent app with firebase with ease. I noticed that the elements in ther/atom
returned bysync-r
are not in the right order. I expect them to be in the same order as they are found in firebase.In my app, I make use of
conj!
to get firebase to generate keys. What's great about this is that firebase offers some guaranties about the order of items when using.push()
(orconj!
in this case). I was hoping to be able to leverage those guaranties.My guess is that I'm having this issue because
sync-r
returns amap
which has no guaranties about order. Would it be possible to get an alternative tosync-r
that returns asorted-map
instead of a regularmap
?I should mention that I am aware of
sync-list
and from what I can tell it does respect ordering. My issue with it is that it doesn't give me access to the key of each element.The text was updated successfully, but these errors were encountered: