lore-hook-connect
Version:
A lore hook that generates dialogs using Bootstrap
38 lines (30 loc) • 871 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
function InvalidGetStateCall(reducerKey) {
var error = new Error('\n Invalid call to \'getState(\'' + reducerKey + '\'). Missing required attribute \'cid\'.\n Expected method call to look like this:\n \n getState(\'' + reducerKey + '\', {\n cid: \'c1\'\n })');
error.name = 'InvalidGetStateCall';
return error;
}
/**
* byCid Connection Blueprint
*/
exports.default = {
defaults: {
cid: null
},
verifyParams: function verifyParams(params) {
if (!params.cid) {
throw new InvalidGetStateCall(this.reducerKey);
}
},
getAction: function getAction(actions) {
// no op
},
getPayload: function getPayload(reducerState, params) {
var key = params.cid;
return reducerState[key];
}
};
module.exports = exports['default'];
;