fudgebucket27 / Lexplorer

Loopring explorer alternative
14 stars 10 forks source link

BaseComponent for CancellationToken handling #197

Open modersohn opened 2 years ago

modersohn commented 2 years ago

Currently the extra code for proper CancellationToken handling is copied e.g. in AccountDetails but also in NFTGrid and a lot of pages don't support it at all (but should!).

The idea is to move this into an ancestor component that provides a new overridable method (e.g. OnParametersSetAsyncWithCTS) that is called after CTS allocation has been done and before it cleans up.

It's not ideal OOP as descendants need to know they need to override the new method instead of OnParametersSetAsync, but I currently don't see a better approach.