-
-
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
Why does MobX 5 array still have the index violation issue? #1822
Comments
There are a few reasons
|
@mweststrate The 2nd reason doesn't look valid to me, because of the 3rd one (as most of the time we don't write out-of-bound assignment). 😂 I am encountering this because of a third-party library https://github.com/flitbit/diff:
Will happy to send a PR for this if you like. |
weird, why would a diff need out of bound assignments? Is .slice() your
array first a simple work around?
Op vr 30 nov. 2018 om 15:20 schreef vilicvane <notifications@github.com>:
… @mweststrate <https://github.com/mweststrate> The 2nd reason doesn't look
valid to me, because of the 3rd one (as most of the time we don't write
out-of-bound assignment). 😂
I am encountering this because of a third-party library
https://github.com/flitbit/diff:
elements in arrays are now processed in reverse order, which fixes a few
nagging bugs but may break some users
Will happy to send a PR for this if you like.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1822 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhNxrNL9hLycFH6DdDFfXrXePyTCYks5u0T6YgaJpZM4YwC0M>
.
|
@mweststrate It's happening on applying changes to existing object. Related issue flitbit/diff#47 I don't see why |
With .slice you could get a temporarily copy of the observable array, that
doesn't have any mobx specific behavior. That could be basis for diff, or
target for the changes. After that you could do
observableArray.replace(modifiedArray) to apply the changes back in a
single action to MobX.
Op vr 30 nov. 2018 om 16:32 schreef vilicvane <notifications@github.com>:
… @mweststrate <https://github.com/mweststrate> It's happening on applying
changes to existing object. Related issue flitbit/diff#47
<flitbit/diff#47>
I don't see why slice would solve this issue, but fortunately there is an
alternative to this functionality in my inventory that works with MobX.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1822 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhMANfnn_-BqLuuH9BZp46PXfZUJnks5u0U-LgaJpZM4YwC0M>
.
|
@mweststrate Ahh, unfortunately not a simple workaround in my case. The object structure is unpredictable (it's like updating/restoring custom objects between versions). Thanks though. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions. |
I have a:
https://runkit.com/embed/56jty1h3u27y
The text was updated successfully, but these errors were encountered: