Skip to content

How to turn signal back into owned value? #3066

Answered by gbj
stefnotch asked this question in Q&A
Discussion options

You must be logged in to vote

.try_update returns a value, so I guess you could .get() the signal. No, there's not a "consume the signal and give me the value" function, because of the arena-based (rather than reference-counted) storage -- there's no guarantee that you don't have other copies of the inner RwSignal lying around so it's not safe to consume the value unless it's disposed. (Whether disposing of a signal should give you its inner value is an interesting question, and not the bad idea, but the first time it's been suggested.)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stefnotch
Comment options

Answer selected by stefnotch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants