mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Send LensMainExtension.nagivate calls to renderer before navigating (#3082)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dc2d7a08d3
commit
c3c944cd30
12 files changed
+100
-51
No files matched your search
@@ -140,3 +140,19 @@ export function* filterMapStrict<T, U>(src: Iterable<T>, fn: (from: T) => U | nu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through `src` until `match` returns a truthy value
|
||||
* @param src A type that can be iterated over
|
||||
* @param match A function that should return a truthy value for the item that you want to find
|
||||
* @returns The first entry that `match` returns a truthy value for, or `undefined`
|
||||
*/
|
||||
export function find<T>(src: Iterable<T>, match: (i: T) => any): T | undefined {
|
||||
for (const from of src) {
|
||||
if (match(from)) {
|
||||
return from;
|
||||
}
|
||||
}
|
||||
|
||||
return void 0;
|
||||
}
|
||||
Reference in new issue
Block a user