'use strict';

var vue = require('vue');

function useMemo(getValue, condition, shouldUpdate) {
  const cacheRef = vue.ref(getValue());
  vue.watch(condition, (next, pre) => {
    if (shouldUpdate) {
      if (shouldUpdate(next, pre))
        cacheRef.value = getValue();
    } else {
      cacheRef.value = getValue();
    }
  });
  return cacheRef;
}

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