Sorry in advance but I have no example in hand now by writing post.
I will try to explain clearly.
I have a MVVM implementation with a fruits property bound to a selectDropdown widget.
This property is an empty array by default (fruits: )
I have a dataSource dsource instance which call a remote endpoint.
I call the fetch method manually and define a callback function which do some tasks :
- viewModel.set('fruits', dsource);
(Note that I didn't applied dsource as default value of my fruits property cause of specific mvvm implementation)
My issue is :
Everything works well unless if my dsource return empty data.
In this case, filter, sort or set dsource to viewModel are calling the read method a second time.
It can call the read method 4 times (1 for first call, 1 for filter, 1 for sort and 1 for view model set method).
Why ? it should not cause my dsource has been instantiated and call a first time...