Skip to content

Commit

Permalink
Expose BatchingRemoteConnection and add missing call method (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
vividviolet authored Aug 8, 2024
1 parent 5ad22e6 commit 6b38a37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-cars-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@remote-dom/core': patch
---

Export BatchingRemoteConnection so it can be used
2 changes: 2 additions & 0 deletions packages/core/source/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ export {customElement} from './elements/decorators/custom-element.ts';
export {BooleanOrString} from './elements/property-types/BooleanOrString.ts';

export type {RemoteConnection} from './types.ts';

export {BatchingRemoteConnection} from './elements/connection.ts';
4 changes: 4 additions & 0 deletions packages/core/source/elements/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export class BatchingRemoteConnection {
this.#batch = batch;
}

call(id: string, method: string, ...args: readonly unknown[]) {
this.#connection.call(id, method, ...args);
}

mutate(records: any[]) {
let queued = this.#queued;

Expand Down

0 comments on commit 6b38a37

Please sign in to comment.