Skip to content
/ redi Public

πŸ’‰ A dependency injection library for TypeScript & JavaScript, along with a binding for React.

License

Notifications You must be signed in to change notification settings

wzhudev/redi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5aec72e Β· Mar 19, 2025
Jan 24, 2025
Dec 31, 2024
Dec 31, 2024
Mar 19, 2025
Jan 24, 2025
Mar 19, 2025
Mar 1, 2024
Feb 8, 2024
Oct 29, 2024
Jan 24, 2025
Jul 10, 2024
Jan 24, 2025
Sep 6, 2021
Dec 31, 2024
Jan 24, 2025
Jan 24, 2025
Jan 24, 2025
Dec 31, 2024
Dec 31, 2024
Dec 31, 2024
Dec 31, 2024

Repository files navigation

redi

Stars Downloads License Codecov

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.wzhu.dev.

Links

Users

  • Univer
  • Team Lark at ByteDance

License

MIT. Copyright 2021-present Wenzhao Hu.