Resolver
Resolver copied to clipboard
Actor Based Register Method
When I try to register an object which is marked as @MainActor then it gives the following error
Call to main actor-isolated initializer 'init()' in a synchronous nonisolated context
Is it possible to support this kind of register method?
This was discussed at some length in Factory. The two solutions are to a) don't do that, or b) mark your init as nonisolated.
The best solution is a) don't mark the entire class as @MainActor. It's usually not necessary. Just mark the async functions @MainActor as needed.
https://github.com/hmlongco/Factory/issues/21