fabulous-dev / Fabulous

Declarative UI framework for cross-platform mobile & desktop apps, using MVU and F# functional programming
https://fabulous.dev
Apache License 2.0
1.15k stars 121 forks source link

add custom application to redirect lifecycle calls to event handler #971

Closed stroborobo closed 2 years ago

stroborobo commented 2 years ago

Hey Fabulous team,

added a custom application class so we can have an event handler for the application lifecycle methods. It's clearly inspired by the custom picker and others, not sure if this is the intended way, appears to be working for me. Feedback very welcome if I should do it differently.

Also, are the docs generated or should I put it in there manually?

stroborobo commented 2 years ago

fixed formatting

TimLariviere commented 2 years ago

Hi. I'm currently on holidays. I'll review your PR in more details later. But first glance, the code seems good 👌

For the documentation, it's manual.

Also do you have a quick explanation for your use case with those events?

stroborobo commented 2 years ago

I'm periodically fetching updated data while the app is open, so I'm both fetching updates and starting a subscription on resume and cancel it's cancellationtoken on sleep.