File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,27 @@ export const organizationClient = createServiceClient(
46
46
"organization" ,
47
47
) ;
48
48
49
+ // @ts -ignore
50
+ window . $testWorkspaceClient = workspaceClient ;
51
+
52
+ // @ts -ignore
53
+ window . $testWatch = ( workspaceId : string ) => {
54
+ const abortController = new AbortController ( ) ;
55
+ const it = workspaceClient . watchWorkspaceStatus (
56
+ { workspaceId } ,
57
+ {
58
+ signal : abortController . signal ,
59
+ } ,
60
+ ) ;
61
+ const startWatchWorkspace = async ( ) => {
62
+ for await ( const workspace of it ) {
63
+ console . log ( "rcv" , workspaceId , JSON . stringify ( workspace ) ) ;
64
+ }
65
+ } ;
66
+ startWatchWorkspace ( ) . then ( ) . catch ( console . error ) ;
67
+ return abortController . abort . bind ( abortController ) ;
68
+ } ;
69
+
49
70
export async function listAllProjects ( opts : { orgId : string } ) : Promise < ProtocolProject [ ] > {
50
71
let pagination = {
51
72
page : 1 ,
Original file line number Diff line number Diff line change @@ -739,7 +739,10 @@ export class WorkspaceService {
739
739
const dispose = this . subscriber . listenForWorkspaceInstanceUpdates ( userId , ( _ctx , instance ) => {
740
740
sink . next ( instance ) ;
741
741
} ) ;
742
- return dispose . dispose ;
742
+ return ( ) => {
743
+ console . log ( "=============dispose" ) ;
744
+ dispose . dispose ( ) ;
745
+ } ;
743
746
} , opts ) ;
744
747
}
745
748
You can’t perform that action at this time.
0 commit comments