"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.watchApp = watchApp;
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
var _effects = require("redux-saga/effects");
var _app = require("../modules/app");
var _marked = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(syncAppState),
  _marked2 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(watchApp);
function syncAppState(action) {
  return (0, _regeneratorRuntime2["default"])().wrap(function syncAppState$(_context) {
    while (1) switch (_context.prev = _context.next) {
      case 0:
      case "end":
        return _context.stop();
    }
  }, _marked);
}
function watchApp() {
  return (0, _regeneratorRuntime2["default"])().wrap(function watchApp$(_context2) {
    while (1) switch (_context2.prev = _context2.next) {
      case 0:
        _context2.next = 2;
        return (0, _effects.takeEvery)(_app.types.SYNC_APP_STATE, syncAppState);
      case 2:
      case "end":
        return _context2.stop();
    }
  }, _marked2);
}