audax
12/03/2025, 2:28 PMEdoardo Luppi
12/03/2025, 2:33 PMaudax
12/03/2025, 2:36 PMaudax
12/03/2025, 2:40 PMEdoardo Luppi
12/03/2025, 2:42 PMcreateSocket function and a Socket interface
• LibB - exports a initConnection(socket: Socket) function
• LibC - exports a initConnection(socket: Socket) function
LibB and LibC depend on LibA, but only use the Socket interface.
In JS, we can then have:
const socket = libA.createSocket();
libB.initConnection(socket);
libC.initConnection(socket);Edoardo Luppi
12/03/2025, 2:42 PMaudax
12/03/2025, 2:42 PMEdoardo Luppi
12/03/2025, 2:43 PMwindow / globalThis, or a "global" scoped to the library?audax
12/03/2025, 2:43 PMaudax
12/03/2025, 2:44 PMaudax
12/03/2025, 2:44 PMEdoardo Luppi
12/03/2025, 2:44 PMEdoardo Luppi
12/03/2025, 2:45 PMaudax
12/03/2025, 2:46 PMimport { getRefToActualSDKKoinLib } from "sdk"
and then pass this to my testing library to use.audax
12/03/2025, 2:46 PMaudax
12/03/2025, 3:08 PMaudax
12/03/2025, 3:08 PMEdoardo Luppi
12/03/2025, 3:11 PMso my when-branches and all the instanceof checks don't workAhhh yes, indeed. Forgot about this "small" detail : (
audax
12/03/2025, 3:21 PMaudax
12/03/2025, 3:30 PM