How can one respond to a Hot Reload?

66 Views Asked by At

I have a long-lived object in my Dart app, created using the output of several computationally expensive functions. Often, I change these expensive functions - but because their output is cached, I cannot see the results of my changes without restarting the app.

Is there a way (perhaps using a Dart VM API) to respond to a Hot Reload and recreate my object accordingly?

Note: I am looking for a solution that does not depend on the Flutter framework, as the relevant code is in a standalone Dart package.

0

There are 0 best solutions below