feat: 2.0.0 beta release
This commit is contained in:
25
src/broadcast.ts
Normal file
25
src/broadcast.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { Document, WithId } from "./types.ts";
|
||||
|
||||
export const BroadcastChannel =
|
||||
globalThis.BroadcastChannel ??
|
||||
class BroadcastChannelMock {
|
||||
onmessage?: any;
|
||||
postMessage() {}
|
||||
close() {}
|
||||
};
|
||||
|
||||
export type StorageBroadcast<TSchema extends Document = Document> =
|
||||
| {
|
||||
name: string;
|
||||
type: "insertOne" | "updateOne";
|
||||
data: WithId<TSchema>;
|
||||
}
|
||||
| {
|
||||
name: string;
|
||||
type: "insertMany" | "updateMany" | "remove";
|
||||
data: WithId<TSchema>[];
|
||||
}
|
||||
| {
|
||||
name: string;
|
||||
type: "flush";
|
||||
};
|
||||
Reference in New Issue
Block a user