Code Monkey home page Code Monkey logo

Comments (3)

msaraiva avatar msaraiva commented on July 30, 2024

Hi @paultannenbaum!

why handle_event methods on Surface.{LiveComponent, LiveView} dont use bracket notation the same way Surface.Component does?

They do :)

Component properties (no matter in what type of component) can either receive a literal like "hide" or an expression like {{ @hideEvent }}, where @hideEvent is just syntactic sugar for assigns.hideEvent.

The golden rule is:

  • Use {{...}} to pass expressions i.e., code that will be evaluated at runtime (any valid Elixir expression is accepted)
  • Use "..." to pass literal strings.

from surface.

paultannenbaum avatar paultannenbaum commented on July 30, 2024

Thanks for the reply. That makes sense, I guess where I was thrown off is the magic that is happening in a click attribute, where passing it a string invokes the message that ultimately calls the callback function of the string literal, which to be fair is what is happening in phoenix-liveview.

Is there a slack or discord channel for the development of this project? I'd be happy to pick up a couple of these issues, but would want to discuss designs before opening up a PR

from surface.

msaraiva avatar msaraiva commented on July 30, 2024

Hey @paultannenbaum!

Is there a slack or discord channel for the development of this project?

Not yet. Sorry. I'll consider doing that when we have more contributors :)

I'd be happy to pick up a couple of these issues, but would want to discuss designs before opening up a PR

That's awesome! Feel free to drop any question you might have on any existing issue or open new ones if you need. If at some point we need to have a chat, we can arrange that too.

Cheers.

from surface.

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.