Add function to access matrix client

This commit is contained in:
Ajay Bura 2022-12-27 20:12:49 +05:30
parent 0a3fe685d1
commit 3cf603bfc6

7
src/client/mx.ts Normal file
View 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!;
};