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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yashmahalwal/react-synced-state

v1.0.5

Published

A react hook to synchronise state updates

Downloads

6

Readme

React Synced State

License TypeScript

Overview

A simple utility to synchronise state updates across your React app.

Documentation

For detailed documentation and API reference, please visit our official documentation. This readme page contains the instructions for setting up the code locally and maintaining it.

Table of Contents

Installing dependencies

To work with the code, start by cloning the repository on your local machine. To set up dependencies, run

npm install

React is a peer dependency of the hook. Since it relies on Providers and simple useState and useEffect, this package can work with any version of React from v16. However, documentation is written using React v18. If you wish to to work with documentation, please ensure v18 is installed.

{
    "peerDependencies": {
      "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
    }
}

Running tests

Tests can be run by using jest:

npm run test

Developing documentation

Source code for documentation is kept under docs-source. Examples for the documentation are used for test cases. Documentation is bundled using parcel. To run the development server for documentation,

npm run docs

To build a static version of the documentation, run

npm run docs:build

This generates the artifacts under docs folder. The relative path for documentation is /react-synced-state since the repository is hosted on github pages which are accessed by url of the form <username>.github.io/<repo-name>. So simply running a http server might not be enough to host the build locally.

Building Code

Code can build for distribution by running

npm run build

This creates a distribution build under build. Code is transpiled down to javascript with es module imports.

License

This project is licensed under the MIT License