UNPKG

@envelop/core

Version:
7 lines (6 loc) 284 B
import { handleMaybePromise } from '@whatwg-node/promise-helpers'; export const useExtendContext = (contextFactory) => ({ onContextBuilding({ context, extendContext }) { return handleMaybePromise(() => contextFactory(context), result => extendContext(result)); }, });