Skip to content

Commit

Permalink
manage cursor from event struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Jan 14, 2024
1 parent 1f050fb commit d2b2809
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/event-engine/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ export const restore = createEvent(
(channels: string[], groups: string[], timetoken: string, region?: number) => ({
channels,
groups,
timetoken,
region,
cursor: {
timetoken: timetoken,
region: region ?? 0,
},
}),
);

Expand Down Expand Up @@ -41,8 +43,10 @@ export const receiveReconnectGiveup = createEvent('RECEIVING_RECONNECT_GIVEUP',
export const disconnect = createEvent('DISCONNECT', () => ({}));

export const reconnect = createEvent('RECONNECT', (timetoken?: string, region?: number) => ({
timetoken,
region,
cursor: {
timetoken: timetoken ?? '',
region: region ?? 0,
},
}));
export const unsubscribeAll = createEvent('UNSUBSCRIBE_ALL', () => ({}));

Expand Down

0 comments on commit d2b2809

Please sign in to comment.