Catch-up subscriptions with Node.js event-store-client

I’m working with the event-store-client package from npm for a Node.js project. I noticed that the API doesn’t seem to include the catch-up subscription facility (i.e. there is no method called subscribeToStreamFrom(…)

Can anyone point me to a demonstration of best practice for implementing the catch up subscription pattern using the limited API offered by the event-store-client package?

I’m thinking of something awkward like readStreamEventsForward from an index that I bookmark in my read model somewhere, but at the same time opening an active subscription so that I don’t miss any new events between the time the forward read ends and the time when the subscription begins. Doing this would mean I’d have to somehow queue the events from the active subscription until I am caught up from the readStreamEventsForward operation. Can someone point me to a best-practice algorithm for handling this cleanly?

The easest way is to just poll readstreameventsforward. Providing the
polling doesn't bother you this is plenty good. The .NET API has
catchup subscriptions, you would probably want almost identical logic
to how they work. Basically you keep a buffer on the subscription and
check to see if the next event you need is in that buffer, if so
switch to the live subscription.

Cheers,

Greg