mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Update typing for circuit-breaker-js
This commit is contained in:
parent
b27c13d93a
commit
7addf7ae18
@ -10,3 +10,11 @@ status = CircuitBreaker.OPEN;
|
||||
|
||||
breaker.forceOpen();
|
||||
breaker.forceClose();
|
||||
|
||||
breaker.run((success, failure) => {
|
||||
if (Math.random() > 0.5) {
|
||||
success();
|
||||
} else {
|
||||
failure();
|
||||
}
|
||||
});
|
||||
|
||||
8
types/circuit-breaker-js/index.d.ts
vendored
8
types/circuit-breaker-js/index.d.ts
vendored
@ -30,7 +30,13 @@ declare class CircuitBreaker {
|
||||
static CLOSED: 2;
|
||||
|
||||
constructor(options?: CircuitBreaker.Options);
|
||||
run(command: () => void, fallback?: () => void): void;
|
||||
run(
|
||||
command: (
|
||||
success: () => void,
|
||||
failure: () => void,
|
||||
) => void,
|
||||
fallback?: () => void
|
||||
): void;
|
||||
forceClose(): void;
|
||||
forceOpen(): void;
|
||||
unforce(): void;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user