Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default resources #3

Merged
merged 2 commits into from
Dec 17, 2023
Merged

Default resources #3

merged 2 commits into from
Dec 17, 2023

Conversation

schell
Copy link
Owner

@schell schell commented Dec 16, 2023

This adds the Gen<T> trait and G: Gen<T> parameter to View and ViewMut.

In practice it makes it so constructing View<T> or ViewMut<T> will generate a default value of T if it doesn't already exist in the graph.

This makes it easier to construct graphs because you no longer have to add all the resources manually. Now you would only have to add the resources that can't be generated with Default.

  • add G: Gen<T> to View
  • add G: Gen<T> to ViewMut

@schell schell force-pushed the feat/view-defaults branch from b702e11 to fa2a922 Compare December 17, 2023 05:23
@schell schell marked this pull request as ready for review December 17, 2023 05:23
@schell schell merged commit 3f1b0ba into main Dec 17, 2023
1 check passed
@schell schell deleted the feat/view-defaults branch December 17, 2023 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant