Building a progressive web app (PWA) usually stands for instant access regardless of network state, but a PWA can offer much more through the use of service workers, including state share across multiple browser tabs and windows.
Sharing the state across tabs can have multiple utilities — for this specific example, let’s think about an e-commerce cart that updates every time we add or remove products. We can efficiently achieve a state share across tabs and windows by combining service workers with React Hooks. Let’s explore that.
We’ll start declaring the cart counter in our state and create the functions responsible to increment and decrement the counter of products on the bag. You can call these functions on a call-to-action button inside your product component, for instance. …
About a year and a half after reaching 1 billion active users, Facebook hit another milestone: over 1 billion active mobile users. Mashable, one of the biggest sources of content about social media, internet news, and digital innovation, published a survey stating that 17.4% of all web traffic comes from mobile devices. This survey was published in 2013, since which time the percentage has steadily crept upward yearly.