conditionalDelay function
Implementation
PollStrategy conditionalDelay(PollPredicate<bool> condition, int timeInMsec) {
return (
Principal canisterId,
RequestId requestId,
RequestStatusResponseStatus status,
) async {
if (await condition(canisterId, requestId, status)) {
final c = Completer();
Future.delayed(Duration(milliseconds: timeInMsec), c.complete);
return c.future;
}
};
}