Disposer typedef

Disposer = FutureOr<void> Function()

A function that performs cleanup operations.

Can be either synchronous (returning void) or asynchronous (returning Future<void>). This flexibility allows disposers to handle both simple cleanup tasks and complex async operations.

Example:

// Synchronous disposer
Disposer syncDisposer = () => print('cleaned up');

// Asynchronous disposer
Disposer asyncDisposer = () async {
  await someAsyncCleanup();
};

Implementation

typedef Disposer = FutureOr<void> Function();