@rws-framework/client
Version:
This package provides the core client-side framework for Realtime Web Suit (RWS), enabling modular, asynchronous web components, state management, and integration with backend services. It is located in `.dev/client`.
28 lines (21 loc) • 961 B
text/typescript
import { loadRWSRichWindow } from "../types/RWSWindow";
import { RWSClientInstance } from "../client";
type RWSInfoType = { components: string[] };
async function loadServices(this: RWSClientInstance){
const richWindow = loadRWSRichWindow();
for (const serviceKey of Object.keys(richWindow.RWS._registered)){
const currentService = this._container.get(richWindow.RWS._registered[serviceKey]);
if(currentService.isInClient() && !Object.keys(this.customServices).includes(serviceKey)){
this.customServices[serviceKey] = currentService;
}
if(currentService.isDefault() && !Object.keys(this.defaultServices).includes(serviceKey)){
this.defaultServices[serviceKey] = currentService;
}
}
}
function getBinds(this: RWSClientInstance){
return {
loadServices: loadServices.bind(this),
};
}
export default getBinds;