UNPKG

2.2 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/DEV/Performance.jsx"],"names":["Performance","perf","disabled","props","componentWillMount","Date","now","name","componentDidMount","componentWillUpdate","componentDidUpdate","children","Component"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;;;;;;IAEaA,W;;;;;;;;;;;;;;;UACXC,I,GAAO,E;;;;;;WACP,qCAA4B;AAAA,UAClBC,QADkB,GACL,KAAKC,KADA,CAClBD,QADkB;AAE1B,UAAIA,QAAJ,EAAc;AACd,WAAKD,IAAL,CAAUG,kBAAV,GAA+BC,IAAI,CAACC,GAAL,EAA/B;AACD;;;WACD,6BAAoB;AAAA,wBACuB,KAAKH,KAD5B;AAAA,UACVD,QADU,eACVA,QADU;AAAA,yCACAK,IADA;AAAA,UACAA,IADA,iCACO,WADP;AAElB,UAAIL,QAAJ,EAAc;AACd,WAAKD,IAAL,CAAUO,iBAAV,GAA8BH,IAAI,CAACC,GAAL,EAA9B,CAHkB,CAIlB;AACD;;;WACD,sCAA6B;AAAA,UACnBJ,QADmB,GACN,KAAKC,KADC,CACnBD,QADmB;AAE3B,UAAIA,QAAJ,EAAc;AACd,WAAKD,IAAL,CAAUQ,mBAAV,GAAgCJ,IAAI,CAACC,GAAL,EAAhC;AACD;;;WACD,8BAAqB;AAAA,yBACsB,KAAKH,KAD3B;AAAA,UACXD,QADW,gBACXA,QADW;AAAA,2CACDK,IADC;AAAA,UACDA,IADC,kCACM,WADN;AAEnB,UAAIL,QAAJ,EAAc;AACd,WAAKD,IAAL,CAAUS,kBAAV,GAA+BL,IAAI,CAACC,GAAL,EAA/B,CAHmB,CAInB;AACD;;;WACD,kBAAS;AACP,aAAO,KAAKH,KAAL,CAAWQ,QAAlB;AACD;;;EA1B8BC,gB;;;eA6BlBZ,W","sourcesContent":["/* eslint-disable camelcase */\nimport { Component } from 'react';\n\nexport class Performance extends Component {\n perf = {};\n UNSAFE_componentWillMount() {\n const { disabled } = this.props;\n if (disabled) return;\n this.perf.componentWillMount = Date.now();\n }\n componentDidMount() {\n const { disabled, name = 'Component' } = this.props;\n if (disabled) return;\n this.perf.componentDidMount = Date.now();\n // console.log(`${name}.mount time ${this.perf.componentDidMount - this.perf.componentWillMount}ms`);\n }\n UNSAFE_componentWillUpdate() {\n const { disabled } = this.props;\n if (disabled) return;\n this.perf.componentWillUpdate = Date.now();\n }\n componentDidUpdate() {\n const { disabled, name = 'Component' } = this.props;\n if (disabled) return;\n this.perf.componentDidUpdate = Date.now();\n // console.log(`${name}.update time ${this.perf.componentDidUpdate - this.perf.componentWillUpdate}ms`);\n }\n render() {\n return this.props.children;\n }\n}\n\nexport default Performance;\n"],"file":"Performance.js"}
\No newline at end of file