refactor(agent-loop): declare the lifecycle disposer before its user
This commit is contained in:
1 parent
aaf01e8182
commit
d6340cc088
1 file changed
+1
-1
@@ -589,6 +589,7 @@ export class AgentLoop extends Service implements AgentFactory {
|
||||
}
|
||||
throwCollectedFailures(failures, `agent "${id}" disposal failed`)
|
||||
})())
|
||||
let unfollowOwner: () => Promise<void> | void
|
||||
const dispose = async (): Promise<void> => {
|
||||
try {
|
||||
await teardown()
|
||||
@@ -597,7 +598,6 @@ export class AgentLoop extends Service implements AgentFactory {
|
||||
}
|
||||
}
|
||||
const untrack = this.ownership.track(dispose)
|
||||
let unfollowOwner: () => Promise<void> | void
|
||||
try {
|
||||
unfollowOwner = ownerCtx.effect(function* () {
|
||||
machine = new ReactLoopAgent(loopCtx, id, options, session)
|
||||
|
||||
Reference in new issue
Block a user