'use strict';

var vue = require('vue');

function createContextFn(key = Symbol("InjectionKey"), context, options = {}) {
  const { writeable = false, reactiveable = true } = options;
  const reactiveContext = vue.reactive(context);
  let provideData;
  if (!reactiveable)
    provideData = context;
  else
    provideData = !writeable ? vue.readonly(reactiveContext) : reactiveContext;
  vue.provide(key, provideData);
}
function useContext(key = Symbol("InjectionKey"), defaultValue) {
  return vue.inject(key, defaultValue || {});
}

exports.createContextFn = createContextFn;
exports.useContext = useContext;
//# sourceMappingURL=index.cjs.map
