Skip to content
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

Link array #110

Open
tomm1e opened this issue Mar 7, 2020 · 1 comment
Open

Link array #110

tomm1e opened this issue Mar 7, 2020 · 1 comment

Comments

@tomm1e
Copy link

tomm1e commented Mar 7, 2020

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.

@tomm1e tomm1e closed this as completed Apr 24, 2020
@brianmhunt brianmhunt reopened this Apr 28, 2020
@brianmhunt
Copy link
Member

Thanks for the great report @tomm1e — I'll try to have a look at it in the not-too-distant future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants