"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getFeatures = void 0;

var _Fetcher = _interopRequireDefault(require("../util/Fetcher"));

var _features = require("../actions/features");

var getFeatures = function getFeatures() {
  var url = '/api/features';
  return function (dispatch, getState) {
    var fetcher = new _Fetcher.default();

    var addFeaturesToStore = function addFeaturesToStore(featuresList) {
      dispatch((0, _features.addFeatures)(featuresList));
    };

    return fetcher.get(url).then(addFeaturesToStore);
  };
};

exports.getFeatures = getFeatures;