Giter Club home page Giter Club logo

a-provider's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @rh-id
  • ๐Ÿ‘€ Iโ€™m interested in Java โ˜• & Android ๐Ÿค– & Computer Vision
  • ๐ŸŒฑ Iโ€™m currently learning Android, Java, Python
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on anything related with java or android or computer vision

a-provider's People

Contributors

rh-id avatar

Stargazers

 avatar

Watchers

 avatar

a-provider's Issues

[Feature] Disposable instances

Currently there is no way for objects registered in the provider to dispose itself. Only ProviderModule have capabilities to dispose itself. This can be a problem when objects are supposed to be initialized lazily, users will be forced to call get(Clazz) to get the value and dispose manually without knowing if the object has been initialized or not.

Special case for registerFactory if an object is produced by factory and is disposable, then should dispose previous object instantiated by this factory before returning new instance, else return the instance as usual.

[Feature] Nested Provider

Nested provider is a provider that has a parent provider. Any registration to nested provider should be registered in its own scope. If provider.get(Clazz) or other type of get doesn't have value in its own scope, the nested provider will try to get(Clazz) from the parent provider.

This is useful especially in android where it has Application, Activity, and Fragment lifecycle/scope where provider in Fragment scope will have parent provider from Activity provider and Activity will have Application provider as parent provider. This will allow chaining get from Fragment scope upwards until Application scope where global singleton components normally live in Application scope.

If Nested provider is disposed it will dispose its own registered components, the parent provider will NOT be disposed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.