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