"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = useReactivated;
var _vue = require("vue");
function useReactivated(callback) {
  var isDeactivatedRef = {
    isDeactivated: false
  };
  var activateStateInitialized = false;
  (0, _vue.onActivated)(function () {
    isDeactivatedRef.isDeactivated = false;
    if (!activateStateInitialized) {
      activateStateInitialized = true;
      return;
    }
    callback();
  });
  (0, _vue.onDeactivated)(function () {
    isDeactivatedRef.isDeactivated = true;
    if (!activateStateInitialized) {
      activateStateInitialized = true;
    }
  });
  return isDeactivatedRef;
}