'use strict';

var vue = require('vue');

function createContext(defaultValue) {
  const contextKey = Symbol("contextKey");
  const useProvide = (props, newProps) => {
    const mergedProps = vue.reactive({});
    vue.provide(contextKey, mergedProps);
    vue.watchEffect(() => {
      Object.assign(mergedProps, props, newProps || {});
    });
    return mergedProps;
  };
  const useInject = () => {
    return vue.inject(contextKey, defaultValue) || {};
  };
  return {
    useProvide,
    useInject
  };
}

exports.createContext = createContext;
//# sourceMappingURL=index.cjs.map
