Skip to content

Commit

Permalink
change streamInfo lastElement to lastId
Browse files Browse the repository at this point in the history
  • Loading branch information
molotgor committed May 13, 2022
1 parent f1f223f commit 3fe0ddc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/helpers/streamInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import { StreamInfo } from '../models/StreamInfo';

export const extractMessageId = ({ lastElement }: StreamInfo) => {
return lastElement;
export const extractMessageId = ({ lastId }: StreamInfo) => {
return `${lastId.streamName}:${lastId.direction.toLowerCase()}:${lastId.index}`;
};

export const extractMessageIds = (streamInfoList: StreamInfo[]) =>
Expand Down
6 changes: 5 additions & 1 deletion src/models/StreamInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export type StreamInfo = {
name: string;
direction: StreamDirection;
};
lastElement: string;
lastId: {
streamName: string;
direction: string;
index: number;
};
};

export type DirectionalStreamInfo = {
Expand Down

0 comments on commit 3fe0ddc

Please sign in to comment.