Sending Messages with the ChannelMessaging API

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • If you want to send messages between two windows, two tabs, or a page and a service worker, and you want those messages to only be accessible between two end points then ChannelMessaging is what you want.
    Code from video: gist.github.co...

Комментарии • 16

  • @AussieInsider
    @AussieInsider Год назад

    I am LOVING your tutorials! 👏🏼 I've learned so much from you! I am stuck though... maybe I have missed something. Let's say I want to cache different files according to a user selection (say an in-app dropdown for example). Would I simply adjust the PRECACHE_URLS array from within app.js?? Or is there some other technique specific to service workers?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      In this video I talk about working with the Cache - ruclips.net/video/zq2xD-xuIG4/видео.html - it will likely help answer your question.
      I have another video about working with the Cache and Promises coming out tomorrow.
      The cache methods are the same both inside a service worker and in your main script.

    • @AussieInsider
      @AussieInsider Год назад

      @@SteveGriffith-Prof3ssorSt3v3 Thanks heaps! Understanding that the cache can be accessed within the main script as well was key :)

  • @luciandumitru6709
    @luciandumitru6709 Год назад

    Thank you for the great content🙏🏾

  • @tahasoft1
    @tahasoft1 Год назад

    Can you explain FinalizationRegistry and WeakRef in JavaScript

  • @shahinza
    @shahinza Год назад

    Thank you 🙏

  • @jimshtepa5423
    @jimshtepa5423 Год назад

    are service workers shared between several tabs on a single machine? or can it be shared between different clients on different parts of the globe?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      Service Workers are shared by all tabs and windows belonging to the same origin that installed the worker. Every time a new window or tab is opened that belongs to that origin, the service worker is connected. The service worker exists on one computer in one browser only. Firefox, Opera, Edge, and Chrome would all have their own copy.

  • @waleedsharif618
    @waleedsharif618 Год назад

    One question: there are many react clones of popular websites tutorial on youtube, can we code a clone and add to our public github repository ? I don't want to use it for any business or sell it to somebody. I want to use it just to get job, that shows my skills, so is it illegal to code for example google clone and add it to my public github repository?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      There is nothing illegal about coding your own clone of another website to demonstrate your understanding of how to do something with React.
      However, if you are just following a tutorial and then using the result of that tutorial on your portfolio, then employers will recognize that immediately and will definitely think twice about what you are actually able to do.

    • @waleedsharif618
      @waleedsharif618 Год назад

      @@SteveGriffith-Prof3ssorSt3v3 so if i code google clone also using google logo and google api for search and add it to my public github repo deployed to be used for non commercial, its ok ? Some people say its illegal

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      @@waleedsharif618 If you are using logos that is copyright infringement. You have to create your own images and change the name of the company.
      It is the functionality that you are cloning for your own repo / portfolio.

    • @AussieInsider
      @AussieInsider Год назад

      @@waleedsharif618 I can tell you first-hand Google won't allow advertising them in your repo or on your website using their logos. I was asked to remove their logos even though I was referring to a project we worked together on

  • @frontend_ko
    @frontend_ko Год назад

    this messaging api looks the most useless compared to the broadcast channel api, clients api, window messaging. what is this for?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      Broadcast api works well when you have an unknown number of clients. You can create lots of different channels - one for each topic and the clients can listen to only the ones they want. Simple to set up and use. Works similarly to the pub sub design pattern.