@@ -61,7 +61,7 @@ export class ActionBase<Context, InitialValue, Value = InitialValue> {
6161 : value
6262
6363 if ( initialOperator && returnValue instanceof Promise ) {
64- returnValue . then ( ( promiseValue ) => {
64+ returnValue . then ( ( ) => {
6565 actionChain . emit ( 'action:end' , {
6666 actionId : executionContext . __execution . actionId ,
6767 executionId : executionContext . __execution . executionId ,
@@ -99,26 +99,34 @@ export class ActionBase<Context, InitialValue, Value = InitialValue> {
9999 ? executionContext . __path . concat ( newPath )
100100 : executionContext . __path . slice ( ) ,
101101 }
102- const path = executionContextWithPath . __path
103102 const prevResult = this . runOperators
104103 ? this . runOperators ( props , executionContextWithPath )
105104 : props
106105
107- const operatorId = ++ executionContextWithPath . __execution . operatorId
108-
109106 const produceResult = ( currentValue ) => {
110107 if ( currentValue instanceof StopExecution ) {
111108 return currentValue
112109 }
113110
114- const context = this . actionChain . getContext ( executionContextWithPath )
111+ const thisExecution = {
112+ ...executionContextWithPath . __execution ,
113+ operatorId : executionContextWithPath . __execution . operatorId + 1 ,
114+ }
115+
116+ executionContextWithPath . __execution . operatorId ++
117+
118+ const path = executionContextWithPath . __path
119+
120+ const context = this . actionChain . getContext (
121+ thisExecution ,
122+ executionContextWithPath
123+ )
115124
116125 this . actionChain . emit ( 'operator:start' , {
117126 type,
118127 name,
119128 path,
120- ...context . __execution ,
121- operatorId,
129+ ...thisExecution ,
122130 } )
123131 const result = cb ( context , currentValue )
124132
@@ -128,18 +136,16 @@ export class ActionBase<Context, InitialValue, Value = InitialValue> {
128136 name,
129137 path,
130138 isAsync : true ,
131- ...context . __execution ,
132- operatorId,
139+ ...thisExecution ,
133140 } )
134141 return result . then ( ( promiseResult ) => {
135142 this . actionChain . emit ( 'operator:end' , {
136143 type,
137144 name,
138145 path,
139- ...context . __execution ,
146+ ...thisExecution ,
140147 isAsync : true ,
141148 result : promiseResult ,
142- operatorId,
143149 } )
144150 return promiseResult
145151 } )
@@ -149,10 +155,9 @@ export class ActionBase<Context, InitialValue, Value = InitialValue> {
149155 type,
150156 name,
151157 path,
152- ...context . __execution ,
158+ ...thisExecution ,
153159 isAsync : false ,
154160 result : result ,
155- operatorId,
156161 } )
157162
158163 return result
0 commit comments