File tree Expand file tree Collapse file tree
packages/app-backend-api/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,28 +28,24 @@ import { Plugin } from './plugin'
2828import { DevtoolsBackend } from './backend'
2929import { AppRecord } from './app-record'
3030
31- let backendOn : DevtoolsHookable
3231const pluginOn : DevtoolsHookable [ ] = [ ]
3332
3433export class DevtoolsApi {
3534 bridge : Bridge
3635 ctx : BackendContext
3736 backend : DevtoolsBackend
37+ on : DevtoolsHookable
3838 stateEditor : StateEditor = new StateEditor ( )
3939
4040 constructor ( backend : DevtoolsBackend , ctx : BackendContext ) {
4141 this . backend = backend
4242 this . ctx = ctx
4343 this . bridge = ctx . bridge
44- if ( ! backendOn ) { backendOn = new DevtoolsHookable ( ctx ) }
45- }
46-
47- get on ( ) {
48- return backendOn
44+ this . on = new DevtoolsHookable ( ctx )
4945 }
5046
5147 async callHook < T extends Hooks > ( eventType : T , payload : HookPayloads [ T ] , ctx : BackendContext = this . ctx ) {
52- payload = await backendOn . callHandlers ( eventType , payload , ctx )
48+ payload = await this . on . callHandlers ( eventType , payload , ctx )
5349 for ( const on of pluginOn ) {
5450 payload = await on . callHandlers ( eventType , payload , ctx )
5551 }
You can’t perform that action at this time.
0 commit comments