Idiomatic way of adding a startup system in 0.10? #8043
Answered
by
NiklasEi
keithsharp
asked this question in
Q&A
-
I've seen both of these patterns used in the documentation and examples: App::new()
.add_startup_system(add_people_system)
.add_system(greet_people_system)
.run() or App::new()
.add_systems((
add_people_system.on_startup(),
greet_people_system,
))
.run(); and was wondering which I should be preferring, and why? |
Beta Was this translation helpful? Give feedback.
Answered by
NiklasEi
Mar 11, 2023
Replies: 1 comment
-
This is very much connected to the discussion in #8005 It's not yet clear what the API should look like to add systems to schedules (startup systems get collected in a startup schedule). I personally prefere your second example, but you can currently use both approaches. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
keithsharp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is very much connected to the discussion in #8005
You can find some pro/contra arguments in there.
It's not yet clear what the API should look like to add systems to schedules (startup systems get collected in a startup schedule). I personally prefere your second example, but you can currently use both approaches.