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

What API replaces observableLength and observableValues? #59

Closed
Aszusz opened this issue Mar 13, 2021 · 3 comments
Closed

What API replaces observableLength and observableValues? #59

Aszusz opened this issue Mar 13, 2021 · 3 comments

Comments

@Aszusz
Copy link

Aszusz commented Mar 13, 2021

Hi,
I'm trying to figure out how to use ObservableArray for add/remove item notifications. I am using tink_state 1.0.0-beta.2, but also tried 0.11.1. In the older version there were (already deprecated) properties observableLength and observableValues. Binding to those properties works correctly for me in 0.11.1. In 1.0.0-beta.2 they no longer work and I cannot figure out what API should I use instead.

@nadako
Copy link
Contributor

nadako commented May 4, 2021

I think Observable.auto(() ->a.length) should work?

@Aszusz
Copy link
Author

Aszusz commented May 10, 2021

OK, so if I want to observe the values should I create Observable first, like this?

var todos = new ObservableArray<Todo>()
var obs = Observable.auto(() -> {todos.toArray();});
obs.bind(values -> listView.dataProvider = new ArrayCollection(values));

Is there any way to get more granular updates (added/deleted/updated) so I can pass them on to the rendering engine (Feathers UI)?

back2dos added a commit that referenced this issue Jul 4, 2021
@back2dos
Copy link
Member

back2dos commented Jul 4, 2021

I decided to undeprecate them after all. As for granular observation, the issue is tracked via #49

@back2dos back2dos closed this as completed Jul 4, 2021
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

3 participants