Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
'use strict';
var _sharePostStatus;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var PUBLICIZE_SHARE = 'PUBLICIZE_SHARE';
var PUBLICIZE_SHARE_SUCCESS = 'PUBLICIZE_SHARE_SUCCESS';
var PUBLICIZE_SHARE_FAILURE = 'PUBLICIZE_SHARE_FAILURE';
var PUBLICIZE_SHARE_DISMISS = 'PUBLICIZE_SHARE_DISMISS';
var sharePostStatus = (_sharePostStatus = {}, _defineProperty(_sharePostStatus, PUBLICIZE_SHARE, function (state, _ref) {
var siteId = _ref.siteId,
postId = _ref.postId;
return _extends({}, state, _defineProperty({}, siteId, _extends({}, state[siteId], _defineProperty({}, postId, {
requesting: true
}))));
}), _defineProperty(_sharePostStatus, PUBLICIZE_SHARE_SUCCESS, function (state, _ref2) {
var siteId = _ref2.siteId,
postId = _ref2.postId;
return _extends({}, state, _defineProperty({}, siteId, _extends({}, state[siteId], _defineProperty({}, postId, {
requesting: false,
success: true
}))));
}), _defineProperty(_sharePostStatus, PUBLICIZE_SHARE_FAILURE, function (state, _ref3) {
var siteId = _ref3.siteId,
postId = _ref3.postId,
error = _ref3.error;
return _extends({}, state, _defineProperty({}, siteId, _extends({}, state[siteId], _defineProperty({}, postId, {
requesting: false,
success: false,
error: error
}))));
}), _defineProperty(_sharePostStatus, PUBLICIZE_SHARE_DISMISS, function (state, _ref4) {
var siteId = _ref4.siteId,
postId = _ref4.postId;
return _extends({}, state, _defineProperty({}, siteId, _extends({}, state[siteId], _defineProperty({}, postId, undefined))));
}), _sharePostStatus);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment