Correct me if I am wrong, Koin in JS seem to be using
::class.getFullName()
as the qualifier. This seems to have a major drawback: if 2 classes are named the same they will count as the same one, even though they are different
Why not use
::class.js
as the qualifier? This grants access to the actual JS implementation so even if 2 classes are named the same they will count as different.
If you really want the Map.Key of the instances to be String you can also use
::class.js.name
. This will provide the actual name of the class which should be unique given a module at least.
Maybe even use the
typeOf<T>()
as the key? This should also solve template collision.