Comments (3)
Feedback as discussed in the meeting:
- withDependencyResolution static function (with timeout overload)
- Basic Lifecycle Handler Support (maybe flag based, default false)??
from spezi.
Completed as of #95
from spezi.
With recent changes in the Spezi framework, I wanted to provide some additional context to this issue.
The latest release of SpeziScheduler uses the following, greatly simplified setup to support the individual creation of Modules:
@testable import Spezi
@testable import SpeziScheduler
let scheduler = Scheduler<String>(tasks: [initialTasks])
// use the internal initializer to resolve dependencies via the `DependencyManager`
_ = Spezi(standard: DefaultStandard(), modules: [scheduler])
// allow for async configuration of modules
try? await _Concurrency.Task.sleep(for: .seconds(0.1))
// use the `scheduler` ...
By making the Spezi
import @testable
, we gain access to the internal initializer of the Spezi
type. This is great as it uses the exact same mechanisms as the spezi(_:)
to resolve the dependency tree and doesn't rely on any unsafe usage of Mirror.
What is up to discussion is how we provide access to this API surface. Requiring a @testable
import might not be the best option and the current initializer of the Spezi
type is currently not really meant for external usage.
Further, some modules might do some asynchronous initialization after configuration. Certain users might want to wait for completion for these operations.
EDIT: Of course, as we do not attach to the SwiftUI view hierarchy, this doesn't set up an AppDelegate and therefore a LifecycleHandler
will never be called.
from spezi.
Related Issues (12)
- Support the Component/Module Creation for Xcode Previews HOT 1
- Remove Generic Type Constraints for Components
- Migrate from the Observable Object Protocol to the Observable Macro
- Validate That Modules Are Only Created Once
- Type-safe Validation of Standard Constraints
- Enforcing Protocol Conformance for Standard Constraints
- Automatically Inject `ObservableObject` Instances
- Easily accessible logger infrastructure for Components and Modules
- Add DocC Documentation Articles
- Update Documentation in Conformance to the Documentation Guide
- Inject Spezi Components as ViewModifier into the SwiftUI view hierarchy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spezi.