There are sometimes resources attached to a connection that need cleaning up – e.g. database connection that's been checked out from a pool.
createSelector(getA, getB, getC, async (a, b, c) => {
return await dbPool.checkout(); // how to clean up this connection?
});
Possible option:
createSelector(getA, getB, getC, async (a, b, c) => {
return await dbPool.checkout();
}).withDisposer(async (a, b, c, con) => {
return await dbPool.release(con);
});