|
há 2 semanas atrás | |
---|---|---|
.. | ||
dist | há 2 semanas atrás | |
esm | há 2 semanas atrás | |
fesm | há 2 semanas atrás | |
react-bindings | há 2 semanas atrás | |
LICENSE | há 2 semanas atrás | |
README.md | há 2 semanas atrás | |
package.json | há 2 semanas atrás |
A dependency library for TypeScript and JavaScript, along with a binding for React.
import { Inject } from '@wendellhu/redi'
class AuthService {
public getCurrentUserInfo(): UserInfo {}
}
class FileListService {
constructor(@Inject(AuthService) private readonly authService: AuthService) {}
public getUserFiles(): Promise<Files> {
const currentUser = this.authService.getCurrentUserInfo()
}
}
const injector = new Injector([[AuthService], [FileListService]])
injector.get(AuthService)
View full documentation on redi.wendell.fun.
MIT. Copyright 2021-present Wenzhao Hu.