redux-user-timing
Version:
User Timing middleware for Redux
3 lines (2 loc) • 465 B
JavaScript
module.exports=function(){return function(e){return function(r){if(!performance||!performance.mark)return e(r);if("object"!=typeof r||!r.type||"string"!=typeof r.type)return console.error("Warning: action type is not valid. Performance measurement is not working properly."),e(r);performance.mark(r.type+"_START");var n=e(r);return performance.mark(r.type+"_END"),performance.measure(""+r.type,r.type+"_START",r.type+"_END"),n}}};
//# sourceMappingURL=index.js.map