Skip to content

Commit a65f537

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

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)