DioxusLabs / sdk

A library to provide abstractions to access common utilities when developing Dioxus applications.
Apache License 2.0
84 stars 13 forks source link

Return something Readable/Writable in the clipboard API #52

Open ealmloff opened 4 months ago

ealmloff commented 4 months ago

Most APIs that let you get and set items in sdk return a signal which implements the readable and writable traits. Those traits expose a bunch of useful helper methods and more fine grained control over reads that return a result when the value is locked or dropped.

The clipboard API just exposes set and get which always panics if the value is dropped causing https://github.com/DioxusLabs/sdk/issues/54. If it implemented readable and writable, you could use try_read and try_write to get and set the value without panicing if the value is dropped