UNPKG

strapi-pfapi

Version:

a strapi plugin library uses local and redis caches to achieve single digit milliseconds on average api response time.

10 lines (9 loc) 260 B
'use strict'; module.exports = (ctx, key) => { if (!ctx.state) ctx.state = {pfapi: {}}; else if (!ctx.state.pfapi) { ctx.state.pfapi = {}; } else if (key && ctx.state.pfapi[key] !== undefined) { return ctx.state.pfapi[key]; } }