Skip to content
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

Documentation: Fix typo in docs/reference/koin-core/modules.md #1670

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/reference/koin-core/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This way, your share the definitions and avoid preallocate factories in a value.

## Overriding definition or module (before 3.1.0)

Koin won't allow you to redefinition an already existing definition (type,name,path ...). You will an an error if you try this:
Koin won't allow you to redefine an already existing definition (type,name,path ...). You will get an error if you try this:

```kotlin
val myModuleA = module {
Expand Down Expand Up @@ -253,20 +253,20 @@ startKoin { modules(featureModule1, featureModule2) }
Notice that all modules will be included only once: `dataModule`, `domainModule`, `featureModule1`, `featureModule2`.

:::info
If you have any compiling issue while including modules from the same file, either use `get()` Kotlin attribute operator on your module eitehr separate each moduel in files. See https://github.com/InsertKoinIO/koin/issues/1341 workaround
If you have any compiling issue while including modules from the same file, either use `get()` Kotlin attribute operator on your module either separate each module in files. See https://github.com/InsertKoinIO/koin/issues/1341 workaround
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence reads kinda screwy to me. I think this makes sense and is what the author intended?

Suggested change
If you have any compiling issue while including modules from the same file, either use `get()` Kotlin attribute operator on your module either separate each module in files. See https://github.com/InsertKoinIO/koin/issues/1341 workaround
If you have any compiling issue while including modules from the same file, use the `get()` Kotlin attribute operator on each module. See https://github.com/InsertKoinIO/koin/issues/1341 workaround

Copy link
Contributor Author

@gustavobarbosab gustavobarbosab Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this note pertains to the creation of modules within the same Kotlin file. This practice can sometimes cause issues in compilation time, and the note intends to inform the developer about it. It recommends separating the modules into distinct files if this kind of problem is happening.

Was this indeed your intention, @arnaudgiuliani?

I think that by changing it like your suggestion, we can lose this information, but if you prefer we can change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, lets keep to say we have both possibility to use get() or separate file. It's more a IDE/Kotlin compilation stuff problem with our include operator

:::

## Lazy modules & background modules loading with Kotlin coroutines [Experimental]

You can now declared "lazy" Koin module, to avoid trigger any pre allocation of resources and load them in background with Koin start.
You can now declare "lazy" Koin module, to avoid trigger any pre allocation of resources and load them in background with Koin start.

- `lazyModule` - declare a Lazy Kotlin version of Koin Module
- `Module.includes` - allow to include lazy Modules
- `KoinApplication.lazyModules` - load lazy modules in background with coroutines, regarding platform default Dispatchers
- `Koin.waitAllStartJobs` - wait for start jobs to complete
- `Koin.runOnKoinStarted` - run block code after start completion

A good example is always betetr to udnerstand:
A good example is always better to understand:

```kotlin
// Some lazy modules
Expand Down
Loading