Add function to access matrix client
This commit is contained in:
parent
0a3fe685d1
commit
3cf603bfc6
1 changed files with 7 additions and 0 deletions
7
src/client/mx.ts
Normal file
7
src/client/mx.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import { MatrixClient } from 'matrix-js-sdk';
|
||||||
|
import initMatrix from './initMatrix';
|
||||||
|
|
||||||
|
export const mx = (): MatrixClient => {
|
||||||
|
if (!initMatrix.matrixClient) console.error('Matrix client is used before initialization!');
|
||||||
|
return initMatrix.matrixClient!;
|
||||||
|
};
|
Loading…
Reference in a new issue