Why doesn't the array sort? #3788
Replies: 1 comment 1 reply
-
The test is that the computed throws when trying to do so :). `ar.sort()`
is by design forbidden on an observable array.
…On Wed, Nov 1, 2023 at 8:59 PM jereklas ***@***.***> wrote:
I'm wondering if someone could explain how the assertion in the array test
case is valid?
https://github.com/mobxjs/mobx/blob/main/packages/mobx/__tests__/v5/base/array.js#L129
Grabbing the value of the computed in the autorun should have caused the
array to become sorted again and the value should be [1,2,3]?
—
Reply to this email directly, view it on GitHub
<#3788>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBED4AKYGTORVO6O2NTYCKS23AVCNFSM6AAAAAA6ZZ2VIOVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVHAYDEOBZHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jereklas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm wondering if someone could explain how the assertion in the array test case is valid?
https://github.com/mobxjs/mobx/blob/main/packages/mobx/__tests__/v5/base/array.js#L129
Grabbing the value of the computed in the autorun should have caused the array to become sorted again and the value should be [1,2,3]?
Beta Was this translation helpful? Give feedback.
All reactions