FlowStacks icon indicating copy to clipboard operation
FlowStacks copied to clipboard

flowDestination calling multiple times.

Open phamdinhduc795397 opened this issue 1 year ago • 1 comments

Hello, I discovered an issue with flowDestination. When adding a value to FlowPath or Routes, flowDestination is called multiple times.

phamdinhduc795397 avatar Jun 29 '24 10:06 phamdinhduc795397

Thanks for raising this. I think it will be necessary to add some caching to avoid calling the closure repeatedly. I will investigate that.

johnpatrickmorgan avatar Jul 01 '24 23:07 johnpatrickmorgan

Hi @johnpatrickmorgan, do you have any suggestions for caching?

phamdinhduc795397 avatar Jul 05 '24 02:07 phamdinhduc795397

Hi @johnpatrickmorgan do you have any suggestions for this issue? This issue has a serious impact on my project. I really hope to get your help. Thank you very much!

DeanFs avatar Jul 19 '24 06:07 DeanFs

@DeanFs If you're using MVVM, you can save ViewModel/ObservableObject on routes to avoid renewing instances when flowDestination is called multiple times.

phamdinhduc795397 avatar Jul 19 '24 15:07 phamdinhduc795397

Hi @johnpatrickmorgan do you have any suggestions for this issue? This issue has a serious impact on my project. I really hope to get your help. Thank you very much!

Sorry @DeanFs, I'm still figuring out the best way to avoid calling the closure repeatedly. So I understand fully, in what way is it impacting your project please? Thanks

johnpatrickmorgan avatar Jul 19 '24 22:07 johnpatrickmorgan

Sorry @DeanFs, I'm still figuring out the best way to avoid calling the closure repeatedly. So I understand fully, in what way is it impacting your project please? Thanks

Hi @johnpatrickmorgan It just caused some trouble with page initialization. For example, a statement that inserts a new instance in the CoreData context at initialization will result in the insertion of many more pieces of meaningless junk data. At present, the implementation method has been changed, and the problem has been solved. But I will continue to pay attention to this issue, once you have the best solution, please let me know! Thank you again for such an excellent framework!

DeanFs avatar Jul 20 '24 10:07 DeanFs

I've made a change to ensure the closure isn't called more than once for the same data at the same index, released in v0.6.4. Thanks for your patience!

johnpatrickmorgan avatar Jul 24 '24 08:07 johnpatrickmorgan