Skip to content

Commit c9c94e7

Browse files
committed
refactor: initialize XRPC within Tsky constructor
1 parent 54afc7a commit c9c94e7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/client/src/bsky/index.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CredentialManager, XRPC } from '@atcute/client';
1+
import { CredentialManager } from '@atcute/client';
22
import { describe, expect, it } from 'vitest';
33
import { Tsky } from '~/index';
44

@@ -31,9 +31,7 @@ async function getAliceTsky() {
3131
password: TEST_CREDENTIALS.alice.appPassword,
3232
});
3333

34-
const xrpc = new XRPC({ handler: manager });
35-
36-
return new Tsky(xrpc);
34+
return new Tsky(manager);
3735
}
3836

3937
describe('bsky', () => {

packages/client/src/tsky/tsky.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import type { XRPC } from '@atcute/client';
1+
import type { CredentialManager } from '@atcute/client';
2+
import { XRPC } from '@atcute/client';
23
import type { Queries } from '@tsky/lexicons';
34
import { Bsky } from '~/bsky';
45
import { Client } from './client';
56

67
export class Tsky {
78
client: Client<Queries>;
89

9-
constructor(xrpc: XRPC) {
10+
constructor(manager: CredentialManager) {
11+
const xrpc = new XRPC({ handler: manager });
1012
this.client = new Client(xrpc);
1113
}
1214

0 commit comments

Comments
 (0)