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

Support Optional Read Signals #2761

Merged
merged 7 commits into from
Aug 1, 2024
Merged

Conversation

DogeDark
Copy link
Member

@DogeDark DogeDark commented Aug 1, 2024

Allows:

#[derive(Props, Clone, PartialEq)]
struct MyTestProps {
    pub optional_read_signal: ReadOnlySignal<Option<u16>>, // This is now truly optional when calling components!
    pub opt: Option<u16>, // Originally you could only get away with this
}

rsx! {
    MyTestComponent {} // Takes MyTestProps. 
}

Closes #2648

@DogeDark DogeDark added core relating to the core implementation of the virtualdom tweak Small changes to improve experience labels Aug 1, 2024
Copy link
Member

@jkelleyrtp jkelleyrtp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@DogeDark DogeDark marked this pull request as draft August 1, 2024 04:59
@DogeDark
Copy link
Member Author

DogeDark commented Aug 1, 2024

I think this might have a fatal flaw This should be fixed

@DogeDark DogeDark marked this pull request as ready for review August 1, 2024 05:05
@DogeDark DogeDark requested a review from jkelleyrtp August 1, 2024 05:18
@jkelleyrtp jkelleyrtp requested a review from ealmloff August 1, 2024 19:04
@ealmloff ealmloff enabled auto-merge (squash) August 1, 2024 19:16
@ealmloff ealmloff merged commit e0bb67b into DioxusLabs:main Aug 1, 2024
14 checks passed
@DogeDark DogeDark deleted the optional-signal branch August 1, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core relating to the core implementation of the virtualdom tweak Small changes to improve experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

props macro isn't recognizing Option inside ReadOnlySignal to make it optional in the builder
3 participants