Most modern JavaScript UI frameworks boast Reactivity, but have you ever wondered what that means exactly?

In my opinion, Reactivity is largely responsible for making modern frontend development unintuitive to outsiders.

This blog post explains what Reactivity is, and how it manifested in the frontend development world today.

You might find this interesting if you’re: a frontend dev unfamiliar with the concept, a non-frontend dev interested in frontend, or just curious what Reactivity is!

  • JonC@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    3
    ·
    4 months ago

    Why the assumption that reactivity is only a front-end thing?

    I’ve used it plenty on the back-end when dealing with streams of data that need to trigger other processing steps.

    • cosmicbytes@programming.devOP
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      4 months ago

      You’re right, and I actually make that point in the blog post! Reactivity is not exclusive to the frontend.

      However, in the frontend, Reactivity is almost an invisible default. You don’t opt into it, you just kinda have to when you use a modern framework.

      In the backend, many people use Reactive patterns without even knowing them or thinking of them. But either way, if you do use them, you likely opted in, and it wasn’t a “all code you write is automatically reactive” like in modern browser ui frameworks

      • CookieOfFortune@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        I mean it tends to show up in the FE due to JS being fundamentally callback based. You’re basically responding to events and the like. Unfortunately the language was not designed for reactivity so they’re all added on via frameworks.

    • GetOffMyLan@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      4 months ago

      While it is popular in the web browser world, it is not inherent to it. Reactive programming is a general programming paradigm that can be applied anywhere, without a UI involved.

      Second paragraph

  • ugo@feddit.it
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    4 months ago

    Code example looks wrong? null is passed as updater to a. As far as I understand, what is passed as callback to a is supposed to be the updater instead (especially since the ctor errors on both val and updater being null). Also, would be more clear what the difference and usage of updater and callback are if they were called something like calcVal and onValChanged respectively