Session Store Implementation doesn't mention that at times `callback` parameter won't be defined
TimDaub opened this issue · 0 comments
TimDaub commented
- I maintain an express/session store and the other day I got someone's contribution that makes calling the
function destroy
's callback optional: attestate/better-sqlite3-session-store#10 - So I looked into https://github.com/expressjs/session#session-store-implementation because I thought that I must have missed this rather important detail
- But I couldn't find any mention that potentially the callback parameter is omitted in some invocations
- So I continued searching and found that a very popular implementation of expressjs/session adds
noop
as thecb
's default value in every function signature: https://github.com/tj/connect-redis/blob/a4770bd07f7a248beb902708b3c1d3914ddb5dc6/lib/connect-redis.js#L12
So, hence, I think the readme's specification should make a mention that callback
may not always be invocable as a JavaScript function.