respond-framework
Version:
create as fast you think
23 lines (22 loc) • 516 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const before = (state, e) => {
if (!e.event.before) return;
const res = e.event.before.call(state, state, e);
if (res === false) {
state.respond.devtools.sendPrevented({
type: 'before',
returned: res
}, e);
} else {
state.respond.devtools.sendPluginNotification({
type: 'before',
returned: res
}, e);
}
return res;
};
var _default = exports.default = before;