Zenject icon indicating copy to clipboard operation
Zenject copied to clipboard

Hope zenject support async method

Open weiweidiy opened this issue 5 years ago • 1 comments

We use "addressable" to load and instantiate resources , howerver, it only apply async method to instantiate gameobject. so we can't use FromComponentInNewPrefab method to create a instance。

weiweidiy avatar Apr 08 '21 09:04 weiweidiy

DI Best practices:

When it comes to applying DI, asynchronous programming should not be an issue. As the construction of object graphs should always be fast, should never depend on any I/O, and, therefore, should always be synchronous.

Async Extensions (experimental)

That said, there's an experimental -but awesome - feature created by @altuncercan. Which you can find in Plugins/Zenject/OptionalExtras/Async This has not been published in any release. So you'll have to to pull it from master.

Read more about it here in the Async documentation

Mathijs-Bakker avatar Apr 11 '21 08:04 Mathijs-Bakker