tko
tko copied to clipboard
Link array
Basically I want one main observable array to act as as a "view" for other arrays, in 3.5 I could use:
model.array(model.other_array) this way I can switch between arrays.
But it doesn't work this way in 4.0. In 4.0 if you call it that way, it will add the array function as the first item into the array, as seen here: https://jsfiddle.net/eimmot/nrLy0kuh/21/, and if I try to call it as the function, nothing shows: https://jsfiddle.net/eimmot/nrLy0kuh/20
3.5 link directly: https://jsfiddle.net/eimmot/nrLy0kuh/8
4.0 w/ valueHasMutated: https://jsfiddle.net/eimmot/nrLy0kuh/15/
4.0 computed: https://jsfiddle.net/eimmot/nrLy0kuh/18/
So, computed is another method I could use for switching arrays, but can make things complex if you have more than one of these arrays on a page, much easier to be able to just link the array like in 3.5.
Thanks for the great report @tomm1e — I'll try to have a look at it in the not-too-distant future.