Skip to content

NamedMultiple

Mauro Gadaleta edited this page Dec 17, 2019 · 2 revisions

Named exports

In order to avoid export default class {className} every single time you create a class is possible to create a named export. Is also possible to use multiple classes in you single JS file.

Named service

Imagine your NamedService.js class file like this

export class NamedService { }

Then your configuration YAML file will look like this in order to use namedService class as service.

services:
  named:
    class: ./../NamedService

Multiple class export

Imagine your MultipleExports.js class file like this

export class ClassOne { }

export class ClassTwo { }

Then your configuration YAML file will look like this in order to use ClassOne and ClassTwo as services.

services:
  one:
    class: ./../MultipleExports
    main: ClassOne
  two:
    class: ./../MultipleExports
    main: ClassTwo