-
-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Koin 1.0] - Revamped DSL & new Module API #131
Comments
arnaudgiuliani
changed the title
[DSL] Rework Koin DSL - introducing Module API
[DSL] Revamped DSL & new Module API
May 16, 2018
arnaudgiuliani
changed the title
[DSL] Revamped DSL & new Module API
Revamped DSL & new Module API
May 17, 2018
Those keyword name changes are great and are now more natural with how other dependency injection libs name things. |
arnaudgiuliani
changed the title
Revamped DSL & new Module API
[Koin 1.0] - Revamped DSL & new Module API
Jun 8, 2018
arnaudgiuliani
pushed a commit
that referenced
this issue
May 15, 2020
arnaudgiuliani
added a commit
that referenced
this issue
May 28, 2020
* update changelog * Updated dependency quote marks in setup docs (#735) * remove build-log dump.txt (#724) * Corrected `applicationContext` to `module` (#779) Updated documentation as per issue #131 in change log * Fix typo in Getting Started with Ktor (#796) * Koin MP setup docv * Fix KoinTestRule test exception handling. Fixes gh-803 Co-authored-by: Arnaud Giuliani <giuliani.arnaud@gmail.com> Co-authored-by: Rajanikant Deshmukh <rajanikant.deshmukh@gmail.com> Co-authored-by: Alexander Falb <221837+elexx@users.noreply.github.com> Co-authored-by: Dacre Denny <dacre@mooce.co.nz> Co-authored-by: Marcus Ramsden <marcus@bitsden.com> Co-authored-by: Jan Mottl <jan.mottl@ackee.cz>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
we have revamped our Koin DSL to make it clearer. We can now declare our module like follow:
A Koin module (declared now with
module
function) can have an innermodule
. This DSL is more neutral and better target the idea of declaring module and inner modules.The following keywords has been deprecated in favor of new ones:
applicationContext
->module
context
->module
bean
->single
(
factory
has not been touched. You can still usebean
keyword)A module is declared in a
path
:module { ... }
-> definitions are in/
module("app") { ... }
-> defintions are in/app
module("app.view") { ... }
-> defintions are in/app/view
Visibility rule is child module can see parent module. This mean that for module:
->
Presenter
can seeRepository
.You can now request a component with the optional
module
parameter, which indicates the required module path to lookup:by inject(module="...")
orget(module="...")
.If you don't use the
module
parameter, you will lookup in all the modules as usual, else you will lookup at given module path.To request
Presenter
class, you can either write itget<Presenter>()
orget<Presenter>(module="app.view")
The old
releaseContext
function has been renamed torelease
. If I want to release thePresenter
instance, I can just use the module path:release("app.view")
This feature has been deployed in
1.0.0-alpha-8
. You can already check it and give us some feedbacks 👍The text was updated successfully, but these errors were encountered: