createJob<T> function

DeferredJob<T> createJob<T>(
  1. Future<T> runner(), {
  2. bool isComplete(
    1. T? data
    )?,
})

must be used for all api calls T is the type of data returned runner isComplete is a guard that can decide if the job is complete or not if complete, the job will not be run again

Implementation

DeferredJob<T> createJob<T>(
  Future<T> Function() runner, {
  bool Function(T? data)? isComplete,
}) {
  return JobCubit<T, T?>(data: null, runner: runner, isComplete: isComplete);
}