Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
7
decreased by-74.07%
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc