README
ServiceService
Dead simple container for service definition and lazy initialization - with strong typings.
import { ServiceService } from 'service-service'
class ExampleService {
private readonly name: string
constructor(name: string, options: { a: string }) {
this.name = name
}
getName() {
return this.name
}
}
// define it in the app's bootstrap file:
ServiceService.define(ExampleService, ['the-name', {
a: 'a-value',
}])
// use it:
const service = ServiceService.use(ExampleService)
service.getName() // will return `the-name`
License
License: MIT
© 2022 Michael Becker