ThirVondukr / aioinject

Async-first python dependency injection library
https://thirvondukr.github.io/aioinject/
MIT License
30 stars 2 forks source link

support batch register #11

Closed nrbnlulu closed 7 months ago

nrbnlulu commented 7 months ago

i.e Before

    cont.register(aioinject.Singleton(get_settings))
    cont.register(aioinject.Singleton(get_redis))
    cont.register(aioinject.Singleton(get_pub_sub))
    cont.register(aioinject.Singleton(EventAbleDeviceRepo))
    cont.register(aioinject.Singleton(EventAbleService))
    cont.register(aioinject.Singleton(EventsPuller))

After

    cont.register(
        aioinject.Singleton(get_settings),
        aioinject.Singleton(get_redis),
        aioinject.Singleton(get_pub_sub),
        aioinject.Singleton(EventAbleDeviceRepo),
        aioinject.Singleton(EventAbleService),
        aioinject.Singleton(EventsPuller),
    )