1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-22 09:02:11 +03:00

More posthog tracking around joining rooms and room search (#7807)

This commit is contained in:
Michael Telatynski
2022-02-17 18:03:27 +00:00
committed by GitHub
parent e997676ae2
commit 658590e5bc
59 changed files with 276 additions and 116 deletions

View File

@@ -28,7 +28,11 @@ export async function timeout<T, Y>(promise: Promise<T>, timeoutValue: Y, ms: nu
}
// Helper method to retry a Promise a given number of times or until a predicate fails
export async function retry<T, E extends Error>(fn: () => Promise<T>, num: number, predicate?: (e: E) => boolean) {
export async function retry<T, E extends Error>(
fn: () => Promise<T>,
num: number,
predicate?: (e: E) => boolean,
): Promise<T> {
let lastErr: E;
for (let i = 0; i < num; i++) {
try {