INNER CODE UNIT · TypeScript
createLoaders
artsy/metaphysics · src/lib/loaders/index.ts:80
export const createLoaders = (accessToken, userID, opts): AvailableLoaders => {
const unauthenticatedLoaders = createLoadersWithoutAuthentication(opts)
let authenticatedLoaders = {}
if (accessToken || opts.xImpersonateUserID) {
authenticatedLoaders = createLoadersWithAuthentication(
accessToken,
userID,
opts
)
}
return {
...unauthenticatedLoaders,
...authenticatedLoaders,
unauthenticatedLoaders,
authenticatedLoaders,
}
}