UNPKG

@zohodesk/utils

Version:

DOT Utils Collection

15 lines (13 loc) 269 B
import { createContext } from 'react'; const context = {}; /** * * @param {string} name * @returns {object} */ export default function contextFactory(name) { if (!context[name]) { context[name] = /*#__PURE__*/createContext(); } return context[name]; }