import { Injectable, container, Service, Singleton } from 'service-x'
@Injectable()
class DemoService extends Service<number> {
defaultState: number = 0
}
// get the instance of DemoService with scope Singleton
const service = container.resolveInScope(DemoService, Singleton)
console.log(service.getState()) // 0