currentPath is not updated when element position in array changes
See original GitHub issueWhen an element’s position in the array changes, this change is not reflected in the currentPath
and jsonPointer
properties of the change object:
Repro
const ObservableSlim = require('observable-slim');
const proxy = ObservableSlim.create([{}, {}]);
ObservableSlim.observe(proxy, changes => changes
.forEach(change => console.log(change.currentPath, change.type)));
proxy.splice(0, 1);
proxy[0].foo = 'bar';
Before: [{}, {}]
After: [{foo: 'bar'}]
Result
0 update
1 delete
length update
1.foo add
However, it should read 0.foo add
, as the object now is the first item of the array.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
react-router v6: get path pattern for current route - Stack Overflow
I made a custom hook useCurrentPath with react-router v6 to get the current path of route, and it work for me. If the...
Read more >C++ O(n) time O(1) space 0 ms - LeetCode Discuss
Mark all visited elements in current path +n or -n depending on current direction. In this way, the "jump information" is not changed...
Read more >Postscript Operators 'p'
For each element in the path, pathforall pushes the element's coordinates on the ... If any of the procedures change the current path,...
Read more >solidjs/solid-router - GitHub
The function will be called with: from (Location): current location (before change). to (string | number}: path passed to navigate . options ( ......
Read more >A look at React Router 6 | Building SPAs - Carl Rippon
Whenever the location changes, Routes finds the child Route element that best matches the path prop to the current location and renders the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@christianliebel I worked on this issue today and I have it very nearly fixed. I’m hoping to push the fix either tomorrow or Monday.
@ElliotNB Looks good, thanks a lot for implementing this fix! I’ve encountered another array-related issue though (at least I think so), but I’ll open another issue for that.
Thank you.