Prerequisites
🚀 Feature Proposal
Currently SessionStore (and request.destroySession) are callback APIs. Ideally these should be Promise-based instead (or support both if you want to keep that).
Since adaptors (such as connect-redis) all expect callback APIs, that API probably has to be kept at least as backing implementation. So dual API (like Fastify itself) probably makes sense.
Motivation
It's more ergonomic, especially in larger async functions.
Example
Instead of
await promisify(sessionStore.set.bind(sessionStore))(
session.sessionId,
session,
);
//
await promisify(sessionStore.destroy.bind(sessionStore))(session.sessionId);
we could do
await sessionStore.set(session.sessionId, session);
//
await sessionStore.destroy(session.sessionId);
Prerequisites
🚀 Feature Proposal
Currently
SessionStore(andrequest.destroySession) are callback APIs. Ideally these should be Promise-based instead (or support both if you want to keep that).Since adaptors (such as
connect-redis) all expect callback APIs, that API probably has to be kept at least as backing implementation. So dual API (like Fastify itself) probably makes sense.Motivation
It's more ergonomic, especially in larger async functions.
Example
Instead of
we could do