GithubHelp home page GithubHelp logo

Comments (4)

khalidabuhakmeh avatar khalidabuhakmeh commented on August 27, 2024

Hi @jch-neos, you should be able to use the hx-trigger with a custom event. That said, I have found using out-of-band updates to also be a good way to update chrome elements (things in the header).

https://htmx.org/attributes/hx-trigger/

from htmx-aspnetcore.

jcheritat avatar jcheritat commented on August 27, 2024

I see how you implemented it and how your last commit corrects the issue (I was getting ready to make a pull request for that 😆)

However I still have a feeling of a scaling issue since you have to include every possible change in you update.
Even using composition like you did it's seems complexe to manage all possible updates linked to an event.

from htmx-aspnetcore.

khalidabuhakmeh avatar khalidabuhakmeh commented on August 27, 2024

@jcheritat it's true, it depends on what you're attempting. If you can have some UI lag then invoking an hx-trigger event after the response comes back would be easier to logic about. All about trade-offs and compromises. :)

I really should think about creating an HTMX.NET online user-group where we can talk about this stuff. 😅

from htmx-aspnetcore.

khalidabuhakmeh avatar khalidabuhakmeh commented on August 27, 2024

👋 Hi folks. I wrote a sample thanks to a blog post from Htmx.Net contributor showing how to use Hx-Trigger to listen and react to global events coming from the server.

This is a nice way to scale up your UI if you don't want to use out-of-band swaps. Try it out!

https://github.com/khalidabuhakmeh/HxTriggerSample

from htmx-aspnetcore.

Related Issues (2)

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.