GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    alcinnz (alcinnz@floss.social)'s status on Thursday, 23-Jan-2025 02:59:34 JST alcinnz alcinnz

    How would you share state between Web Components? - Go Make Things:
    https://gomakethings.com/how-would-you-share-state-between-web-components/

    In conversation about 5 months ago from floss.social permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: gomakethings.com
      How would you share state between Web Components?
      Yesterday, I had an interesting chat with a friend about how I would share state between Web Components, and get them to talk to each other in a web app. Today, let’s explore what that might look like! An ecommerce platform An example I like to use for this kind of thing is an ecommerce platform with a few interconnected components. You might have a Web Component that displays a link to the checkout page, with the number of items in the cart as it’s text.
    • Embed this notice
      Marc Etienne (fnordius@muenchen.social)'s status on Thursday, 23-Jan-2025 03:06:20 JST Marc Etienne Marc Etienne
      in reply to

      @alcinnz I do something similar, relying solely on custom events to broadcast changes that other components might need to sync to. Each event has three bits in its payload:
      * the new value
      * the Group ID of the elements that the event is intended for
      * the ID of the broadcaster, so it can ignore what it itself said

      I find it works like a charm, as I use web components sparingly in HTML templates.

      In conversation about 5 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.