Skip to content

Commit

Permalink
rename to command
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Apr 15, 2024
1 parent 6cc92fc commit 2a21556
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions extension/src/flow-cli/binary-versions-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ export class BinaryVersionsProvider {
})
}

add (path: string): void {
if (this.#caches[path] != null) return
this.#caches[path] = new StateCache(async () => await this.#fetchBinaryInformation(path))
this.#caches[path].subscribe(() => {
add (command: string): void {
if (this.#caches[command] != null) return
this.#caches[command] = new StateCache(async () => await this.#fetchBinaryInformation(command))
this.#caches[command].subscribe(() => {
this.#rootCache?.invalidate()
})
this.#rootCache?.invalidate()
}

remove (path: string): void {
remove (command: string): void {
// Known binaries cannot be removed
if (this.#caches[path] == null || (Object.values(KNOWN_FLOW_COMMANDS) as string[]).includes(path)) return
if (this.#caches[command] == null || (Object.values(KNOWN_FLOW_COMMANDS) as string[]).includes(command)) return
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete this.#caches[path]
delete this.#caches[command]
this.#rootCache?.invalidate()
}

Expand Down

0 comments on commit 2a21556

Please sign in to comment.