npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

synco-redux

v1.4.0

Published

A lightweight Redux enhancer for syncing state across different environments, including browser extensions and Electron applications

Readme

synco-redux NPM Version

A lightweight Redux enhancer for syncing state across different environments, including browser extensions and Electron applications.

Table of Contents

How It Works

Synco-Redux follows a main-proxy store architecture:

  • Main Store: Acts as the single source of truth. It processes all dispatched actions and broadcasts state updates to all connected proxy stores.
  • Proxy Stores: Do not process actions themselves. Instead, they forward actions to the main store and later update their internal state based on the changes broadcast from the main store.

This setup ensures a consistent state across different processes.

Installation

npm install synco-redux

Browser extension

Synco-Redux enables seamless state synchronization between different parts of a browser extension, such as the background script, popup, popovers, extension tabs, and content scripts.

It uses browser ports for communication (chrome.runtime.connect or browser.runtime.connect), ensuring an efficient message-based state synchronization.

Note: The enhancer should be used with the webextension-polyfill package or by passing chrome or browser directly to the communication object.

1. Main Store

The background script should initialize the main store, as it serves as the single source of truth.

import { configureStore } from '@reduxjs/toolkit';
import Browser from 'webextension-polyfill';

import { createMainStoreEnhancer, PortMainComms } from 'synco-redux';

const mainComms = new PortMainComms(Browser);

const mainStore = configureStore({
	reducer: appSlice.reducer,
	enhancers: (getDefaultEnhancers) =>
		getDefaultEnhancers().concat(createMainStoreEnhancer(mainComms))
});

2. Proxy Store

Proxy stores should be created in UI components (like popups, options pages, or content scripts). These stores do not process actions themselves but instead forward them to the main store.

import { configureStore } from '@reduxjs/toolkit';
import Browser from 'webextension-polyfill';

import {
	createProxyStoreEnhancer,
	immerProxyStoreReducer,
	PortProxyComms
} from 'synco-redux';

const proxyComms = new PortProxyComms(Browser);

const proxyStore = configureStore({
	reducer: immerProxyStoreReducer,
	enhancers: (getDefaultEnhancers) =>
		getDefaultEnhancers().concat(createProxyStoreEnhancer(proxyComms))
});

Electron

Synco-Redux enables seamless state synchronization between the main process and multiple renderer processes (such as different browser windows or webviews) in Electron applications. It uses Electron's Context Bridge and IPC (Inter-Process Communication) for secure and sandboxed state synchronization.

1. Main Store

The main store runs in Electron's main process and acts as the single source of truth.

import { configureStore } from '@reduxjs/toolkit';

import { createMainStoreEnhancer, ElectronComms } from 'synco-redux';
import { BrowserWindow, ipcMain } from 'electron';

const mainComms = new ElectronComms(ipcMain, BrowserWindow.getAllWindows);

const mainStore = configureStore({
	reducer: appSlice.reducer,
	enhancers: (getDefaultEnhancers) =>
		getDefaultEnhancers().concat(createMainStoreEnhancer(mainComms))
});

2. Proxy Store

Each Electron renderer process (such as a browser window or webview) should create a proxy store. These stores do not process actions but instead forward them to the main store.

import { configureStore } from '@reduxjs/toolkit';

import {
	createProxyStoreEnhancer,
	ElectronProxyComms,
	immerProxyStoreReducer
} from 'synco-redux';

const proxyComms = new ElectronProxyComms();

const proxyStore = configureStore({
	reducer: immerProxyStoreReducer,
	enhancers: (getDefaultEnhancers) =>
		getDefaultEnhancers().concat(createProxyStoreEnhancer(proxyComms))
});

3. Preload

To bridge communication between the main and renderer processes in a sandboxed environment, use Electron's Context Bridge in the preload script.

import { contextBridge, ipcRenderer } from 'electron';
import { registerSyncoReduxContextBridge } from './electronUtils';

registerSyncoReduxContextBridge(contextBridge, ipcRenderer);	

Helpers

isProxyReady = (proxyStore: Store) => Promise<boolean>; - Checks if a proxy store is synced with the main store and ready to dispatch events.

isProxyReadySync = (proxyStore: Store) => boolean; - Checks if a proxy store is synced with the main store and ready to dispatch events.

isProxyStore = (store: Store) => Promise<boolean>; - Determines if a given store is a proxy store or not.