🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

simple-boot-core

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-boot-core

front end SPA frameworks

1.0.22
Source
npm
Version published
Maintainers
1
Created
Source

SIMPLE-BOOT-CORE

Sim LifeCycle

OnSimCreate

  • onSimCreate: Object create
const option = new SimOption([GlobalAdvice]);
const simpleApplication = new SimpleApplication(AppRouter, option);
simpleApplication.run();
const intent = new Intent('/b/asd/vv');
simpleApplication.routing<SimAtomic<any>, any>(intent).then(it => {
    console.log('--->', it.pathData, it.routerChains);
    let moduleInstance = it.getModuleInstance<User>();
    console.log('-22->', moduleInstance);
    moduleInstance?.print();
    console.log('------->' , simpleApplication.routerManager.activeRouterModule)
});
@Sim()
@Router({
    route: {
        '': '/',
        '/': [A, {a: 123}],
        '/b': B,
        '/b/:aa/vv': [B, {b:'zzzzz'}]
    },
    path: '',
    routers: [UserRouter]
})
export class AppRouter implements RouterAction {


    constructor() {
    }


    canActivate(url: Intent, module: any): void {
        console.log('AppRouter canActivate->>>>>', url, module)
    }
}

router

  • RouterAction
    • canActivate(url: Intent, module: any): void
@Sim({scheme: 'A'})
export class A {
    constructor() {
        console.log('--->aA')
    }

    print(){
        console.log('print')
    }

    gogo(intent: Intent) {
        console.log('gogogo', intent);
    }
}


intent subscribe

  • IntentSubscribe
    • intentSubscribe(intent: Intent): void;
@Sim()
export class B {
    constructor(private a: A, private routerManager: RouterManager, private simstanceManager: SimstanceManager) {
    }

    print() {
        this.a.print();
        console.log('bbb print', this.routerManager.activeRouterModule.pathData.aa)
    }

    intentSubscribe(intent: Intent) {
        //receive    
    }
    
    err() {
        throw new UserNotFound('good');
    }
}

Keywords

module

FAQs

Package last updated on 20 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts