createJob<T> function
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);
}