Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wzhudev/redi
💉 A dependency injection library for TypeScript & JavaScript, along with a binding for React.
https://github.com/wzhudev/redi
dependency-injection ioc react typescript
Last synced: 9 days ago
JSON representation
💉 A dependency injection library for TypeScript & JavaScript, along with a binding for React.
- Host: GitHub
- URL: https://github.com/wzhudev/redi
- Owner: wzhudev
- License: mit
- Created: 2021-08-22T04:17:00.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-01T02:39:31.000Z (8 months ago)
- Last Synced: 2024-04-14T07:10:19.019Z (7 months ago)
- Topics: dependency-injection, ioc, react, typescript
- Language: TypeScript
- Homepage: https://redi.wendell.fun
- Size: 425 KB
- Stars: 77
- Watchers: 3
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redi
![Stars](https://badgen.net/github/stars/wzhudev/redi)
![Downloads](https://badgen.net/npm/dt/@wendellhu/redi)
![License](https://badgen.net/github/license/wzhudev/redi)
[![Codecov](https://img.shields.io/codecov/c/github/wzhudev/redi.svg)](https://codecov.io/gh/wzhudev/redi)A dependency library for TypeScript and JavaScript, along with a binding for React.
## Overview
```typescript
import { Inject } from '@wendellhu/redi'class AuthService {
public getCurrentUserInfo(): UserInfo {}
}class FileListService {
constructor(@Inject(AuthService) private readonly authService: AuthService) {}public getUserFiles(): Promise {
const currentUser = this.authService.getCurrentUserInfo()
}
}const injector = new Injector([[AuthService], [FileListService]])
injector.get(AuthService)
```**View full documentation on [redi.wendell.fun](https://redi.wendell.fun/).**
## Links
- [Demo TodoMVC](https://wzhudev.github.io/redi-todomvc/) | [source](https://github.com/wzhudev/redi-todomvc)
- [Doc site](https://redi.wendell.fun) | [source](https://github.com/wzhudev/redi-site)
- [Scaffold](https://github.com/wzhudev/redi-starter)## Users
- [Univer](https://github.com/dream-num/univer)
- Team Lark at ByteDance## License
MIT. Copyright 2021-present Wenzhao Hu.