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

Create Helper Method For ReadOnlySignal #3921

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DogeDark
Copy link
Member

@DogeDark DogeDark commented Mar 26, 2025

Adds ReadOnlySignal::create(T) which is a shorthand for ReadOnlySignal::new(Signal::new(T)).

This helps with #3920

Seems like Signal.into() also currently works.

@DogeDark DogeDark added enhancement New feature or request signals Related to the signals crate labels Mar 26, 2025
@DogeDark DogeDark requested a review from a team as a code owner March 26, 2025 22:42
@DogeDark DogeDark requested a review from Copilot March 26, 2025 22:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a helper method, create, to simplify the instantiation of ReadOnlySignal by wrapping a new Signal into the new read-only signal.

  • Introduces a create method as a shorthand for ReadOnlySignal::new(Signal::new(value))
  • Adds the necessary documentation and attributes to the new method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request signals Related to the signals crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant