File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -919,6 +919,22 @@ class Runtime extends EventEmitter {
919919 return 'RUNTIME_DISPOSED' ;
920920 }
921921
922+ /**
923+ * Event name when _step() has been called.
924+ * @const {string}
925+ */
926+ static get RUNTIME_STEP_START ( ) {
927+ return 'RUNTIME_STEP_START' ;
928+ }
929+
930+ /**
931+ * Event name when _step() has finished all processing within the function.
932+ * @const {string}
933+ */
934+ static get RUNTIME_STEP_END ( ) {
935+ return 'RUNTIME_STEP_END' ;
936+ }
937+
922938 /**
923939 * Event name for reporting that a block was updated and needs to be rerendered.
924940 * @const {string}
@@ -2581,6 +2597,11 @@ class Runtime extends EventEmitter {
25812597 * inactive threads after each iteration.
25822598 */
25832599 _step ( ) {
2600+ // RUNTIME_STEP_START runs before BEFORE_EXECUTE
2601+ // this runs before any processing of this new step
2602+ this . frameLoop . _stepCounter ++ ;
2603+ this . emit ( Runtime . RUNTIME_STEP_START ) ;
2604+
25842605 if ( this . interpolationEnabled ) {
25852606 interpolate . setupInitialState ( this ) ;
25862607 }
@@ -2664,6 +2685,9 @@ class Runtime extends EventEmitter {
26642685 if ( this . interpolationEnabled ) {
26652686 this . _lastStepTime = Date . now ( ) ;
26662687 }
2688+
2689+ // RUNTIME_STEP_END runs after AFTER_EXECUTE
2690+ this . emit ( Runtime . RUNTIME_STEP_END ) ;
26672691 }
26682692
26692693 /**
You can’t perform that action at this time.
0 commit comments