-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
suggestion: entries(observableMap) #1416
Comments
Was thinking about that. But note that Array.from(observableMap) achieves
the same
Op do 15 mrt. 2018 om 18:34 schreef Javier Gonzalez <
[email protected]>:
… Would go great alongside the new values(), and keys()
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1416>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhKwGbOytJCymLuAJ5z1D8yyi5QWkks5teqYvgaJpZM4SslUA>
.
|
Yep, but I guess entries (as well as its values and keys friends) is an optimized version that doesn't try to create an array if it is already an array? |
If there's any performance improvement in entries() as opposed to Array.from(map) then I definitely agree. Just a heads up: https://jsperf.com/set-iterator-vs-foreach/4 We should probably use array spread syntax [...myMap.values()] instead of array.from, since it seems to be much better optimized for both current and especially the upcoming browsers (look at the huge performance improvement in current bleeding edge chrome 67 canarian - just verified it) |
PR is welcome for this one! Should be pretty straight forward :) |
Is this not already implemented here? Or am I missing something? |
Should the issue be resolved already? @xaviergonz |
No, this issue is about a top-level api, not a map api, like these:
https://github.com/mobxjs/mobx/blob/8cccd9330a88a2a4dee4c038a60c1fac8ed965d6/src/api/object-api.ts
Op vr 4 mei 2018 om 10:28 schreef quanganhtran <[email protected]>:
… Should the issue be resolved already? @xaviergonz
<https://github.com/xaviergonz>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1416 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhKhZcwTz3WeZsUXZ2u92uR5DVQfyks5tvBEpgaJpZM4SslUA>
.
|
I see I’ll give the implementation a go! |
here is the PR 👍 #1536 |
Released in 4.3.0 |
Would go great alongside the new values(), and keys()
The text was updated successfully, but these errors were encountered: