isSync method
Returns true if the action is SYNC, and false if the action is ASYNC.
The action is considered SYNC if the before
method, the reduce
method,
and the wrapReduce
methods are all synchronous.
Implementation
bool isSync() {
//
/// Must check that it's NOT `Future<void> Function()`, as `void Function()` doesn't work.
bool beforeMethodIsSync = before is! Future<void> Function();
bool reduceMethodIsSync = reduce is St? Function();
bool wrapReduceMethodIsSync = wrapReduce(() => null) is! Future<St?> Function();
return (beforeMethodIsSync && reduceMethodIsSync && wrapReduceMethodIsSync);
}