Skip to content

Commit 214d4f4

Browse files
committed
chore: add connect/disconnect for in-memory client to satisfy replane interface
1 parent 20a7a3c commit 214d4f4

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

packages/sdk/src/in-memory.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import type {
3535
} from "./client-types";
3636
import { ReplaneError, ReplaneErrorCode } from "./error";
3737
import { evaluateOverrides } from "./evaluation";
38+
import type { Replane } from "./client";
3839

3940
/**
4041
* Options for setting a config with overrides.
@@ -113,11 +114,27 @@ function asHandle<T extends object>(client: InMemoryReplane<T>): InMemoryReplane
113114
*
114115
* @typeParam T - Type definition for config keys and values
115116
*/
116-
export class InMemoryReplane<T extends object = Record<string, unknown>> {
117+
export class InMemoryReplane<T extends object = Record<string, unknown>> implements Replane<T> {
117118
constructor(options: InMemoryReplaneOptions<T> = {}) {
118119
asHandle(this)._impl = new InMemoryReplaneImpl<T>(options);
119120
}
120121

122+
/**
123+
* This method exists only to satisfy the Replane interface.
124+
* It does nothing and always resolves immediately.
125+
*/
126+
connect(): Promise<void> {
127+
return Promise.resolve();
128+
}
129+
130+
/**
131+
* This method exists only to satisfy the Replane interface.
132+
* It does nothing.
133+
*/
134+
disconnect(): void {
135+
return;
136+
}
137+
121138
/**
122139
* Get a config value by name.
123140
*

0 commit comments

Comments
 (0)