Skip to content

Commit

Permalink
feat: use empty store
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo committed Oct 27, 2024
1 parent 89f0c9b commit af5da64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/github/utils/kv-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export interface KvStore<T> {
* @template T - The type of values to be stored.
*/
export class EmptyStore<T> implements KvStore<T> {
constructor(kv: KVNamespace) {
console.log(`Creating empty kv`, kv);
}

get(id: string): Promise<T | null> {
console.log(`get KV ${id}`);
return Promise.resolve(null);
Expand Down
4 changes: 2 additions & 2 deletions tests/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as crypto from "crypto";
import { createPlugin } from "../src/sdk/server";
import { Context } from "../src/sdk/context";
import { GitHubEventHandler } from "../src/github/github-event-handler";
import { CloudflareKv } from "../src/github/utils/cloudflare-kv";
import { EmptyStore } from "../src/github/utils/kv-store";
import { PluginChainState, PluginInput } from "../src/github/types/plugin";
import { EmitterWebhookEventName } from "@octokit/webhooks";

Expand Down Expand Up @@ -36,7 +36,7 @@ const eventHandler = new GitHubEventHandler({
webhookSecret: "test",
appId: "1",
privateKey: privateKey,
pluginChainState: undefined as unknown as CloudflareKv<PluginChainState>,
pluginChainState: new EmptyStore<PluginChainState>(),
});

const app = createPlugin(
Expand Down

0 comments on commit af5da64

Please sign in to comment.