November Papa Mike

    @wendellhu/redi
    TypeScript icon, indicating that this package has built-in type declarations

    0.6.0 • Public • Published

    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.wendell.fun.

    Links

    Users

    • Team Lark at ByteDance

    Development

    Install dev dependencies with pnpm.

    pnpm i

    Test with vitest.

    pnpm run test

    Develop API site.

    pnpm run doc:api:watch

    License

    MIT. Copyright 2021-2022 Wendell Hu.

    Keywords

    none

    Install

    npm i @wendellhu/redi

    DownloadsWeekly Downloads

    6

    Version

    0.6.0

    License

    MIT

    Unpacked Size

    467 kB

    Total Files

    84

    Last publish

    Collaborators

    • wendellhu95