Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: fetchHistory this
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossantos74 committed Mar 21, 2024
1 parent 83d0938 commit 306cb10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/realtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export class Realtime extends BaseComponent {
* @description get realtime client data history
* @returns {RealtimeMessage | Record<string, RealtimeMessage>}
*/
public async fetchHistory(
public fetchHistory = async (
eventName?: string,
): Promise<RealtimeMessage[] | Record<string, RealtimeMessage[]> | null> {
): Promise<RealtimeMessage[] | Record<string, RealtimeMessage[]> | null> => {
const history: RealtimeMessage[] | Record<string, RealtimeMessage[]> = await new Promise(
(resolve, reject) => {
const next = (data: Socket.RoomHistory) => {
Expand Down Expand Up @@ -149,7 +149,7 @@ export class Realtime extends BaseComponent {
);

return history;
}
};

/**
* @function changeState
Expand Down

0 comments on commit 306cb10

Please sign in to comment.