Giter VIP home page Giter VIP logo

Comments (3)

ealmloff avatar ealmloff commented on September 27, 2024

The majority of methods for Signal are implemented on the Readable and Writable trait. One of the methods on the Readable trait is cloned which clones the value out of the signal.

This seems more like a docs/discoverability issue than anything else. I agree looking at the docs of Signal, it isn't clear that you can call the struct or use methods from readable and writable. It would be more clear if we included more examples in the signal docs (including calling the signal like a function) and links to the relevant traits (Readable and Writable)

Implementing the Fn trait itself would also be much more clear than Deref, but unfortunately fn_traits has not landed in stable yet.

from dioxus.

jprider63 avatar jprider63 commented on September 27, 2024

Thanks, that's good to know about cloned. I tried using read, but that returned a GenerationalRef which I wasn't sure what to do with.

I was unaware of fn_traits. That also seems like a bad idea in my opinion, but that's a separate issue.

from dioxus.

ealmloff avatar ealmloff commented on September 27, 2024

The docs were improved in #2460 to reference the readable and writable traits and include more examples

from dioxus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.