0.6.1 • Published 2 years ago
@darkyzhou/redi v0.6.1
redi
A dependency library for TypeScript and JavaScript, along with a binding for React.
Overview
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.
Links
- Demo TodoMVC | source
- Doc site source
- scaffold
Users
- Team Lark at ByteDance
License
MIT. Copyright 2021-2022 Wendell Hu.