Тут совсем недавно вышло крутое обновление библиотеки Koin, которое позволяет гораздо проще настраивать сам Koin — Constructor DSL.
Раньше типичный модуль в Koin выглядел следующим образом: class MyClassA() class MyClassB(val a : MyClassA)
// Let Koin find dependencies for you with get() module { single { MyClassA() } single { MyClassB(get()) } }
Как видно, в MyClassB нужно добавить get() по количеству параметров, которые в этот класс передаются. Если таких параметров будет много, то и число этих get() будет кратно увеличиваться.
В новой же версии мы получаем более удобную структуру:
class MyClassA(val id : String)
module { singleOf(::MyClassA) }
// in calling code val classA : MyClassA by inject { parametersOf("_id_")}
То есть теперь все вызовы get() останутся в прошлом, и мы получим гораздо более красивый и читаемый код. Больше примеров кода и инфа о других изменениях по ссылке.
Тут совсем недавно вышло крутое обновление библиотеки Koin, которое позволяет гораздо проще настраивать сам Koin — Constructor DSL.
Раньше типичный модуль в Koin выглядел следующим образом: class MyClassA() class MyClassB(val a : MyClassA)
// Let Koin find dependencies for you with get() module { single { MyClassA() } single { MyClassB(get()) } }
Как видно, в MyClassB нужно добавить get() по количеству параметров, которые в этот класс передаются. Если таких параметров будет много, то и число этих get() будет кратно увеличиваться.
В новой же версии мы получаем более удобную структуру:
class MyClassA(val id : String)
module { singleOf(::MyClassA) }
// in calling code val classA : MyClassA by inject { parametersOf("_id_")}
То есть теперь все вызовы get() останутся в прошлом, и мы получим гораздо более красивый и читаемый код. Больше примеров кода и инфа о других изменениях по ссылке.
Private channels are only accessible to subscribers and don’t appear in public searches. To join a private channel, you need to receive a link from the owner (administrator). A private channel is an excellent solution for companies and teams. You can also use this type of channel to write down personal notes, reflections, etc. By the way, you can make your private channel public at any moment. While some crypto traders move toward screaming as a coping mechanism, many mental health experts have argued that “scream therapy” is pseudoscience. Scientific research or no, it obviously feels good. The SUCK Channel on Telegram, with a message saying some content has been removed by the police. Photo: Telegram screenshot. Content is editable within two days of publishing The group also hosted discussions on committing arson, Judge Hui said, including setting roadblocks on fire, hurling petrol bombs at police stations and teaching people to make such weapons. The conversation linked to arson went on for two to three months, Hui said.
from us