restrictions
2 years ago
BrowserReporting.js
2 years ago
ReportingContext.js
2 years ago
ReportingInterface.js
2 years ago
RestrictionError.js
2 years ago
functions.js
2 years ago
ReportingContext.js
27 lines
| 1 | function ReportingContext( root ) { |
| 2 | /** |
| 3 | * @type {Observable} |
| 4 | */ |
| 5 | this.root = root; |
| 6 | |
| 7 | this.reportedFirst = false; |
| 8 | this.silence = true; |
| 9 | |
| 10 | } |
| 11 | |
| 12 | ReportingContext.prototype = { |
| 13 | reset( props = {} ) { |
| 14 | this.reportedFirst = false; |
| 15 | this.setSilence( props?.silence ?? true ); |
| 16 | }, |
| 17 | reportFirst() { |
| 18 | this.reportedFirst = true; |
| 19 | }, |
| 20 | setSilence( value ) { |
| 21 | this.silence = !!value; |
| 22 | }, |
| 23 | }; |
| 24 | |
| 25 | export default ReportingContext; |
| 26 | |
| 27 |