New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ez-sync-js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ez-sync-js

This is an agnostic javascript library that synchronizes shared data/state throughout your app. It is tiny, unopinionated and can interface with and/or replace Redux. It can easily be extended to coordinate with an API or something like firebase or pubnub

  • 1.0.12
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Sync.js

This is an agnostic javascript library that synchronizes shared data/state throughout your app. It is tiny, unopinionated and can interface with and/or replace Redux. It can easily be extended to coordinate with an API or something like firebase or pubnub. It is optimized for high performance and low foot print and has zero dependencies.

You can use sync with or without React, Redux, or any other framework.

raw usage without React or Redux:

    import sync from 'ez-sync-js/Sync

    // update a value
    sync.dispatch('myVar', 'some value')

    // repeat the last update
    sync.echo('myVar')
    
    ...

    // gets the latest update
    const myVar = sync.get('myVar').detail 

    ...

    // subscribe to future updates
    sync.addListener('myVar', callback)
    
    // unsubscribe
    sync.removeListener('myVar', callback)

useSync - React

Is used just like useState except now you can have different React components anywhere in the app or dom that share the same values (sync) without depending on Redux or Context, nor do the components have to be running concurrently to stay syncrhonized.

See the demo

React usage:

    import {useSync} from 'ez-sync-js'

    const [myVar, setVar] = useSync('myVar','optional initial value')

diagram

Source Code - git

https://github.com/chadsteele/sync

NPM

It's called ez-sync-js https://www.npmjs.com/package/ez-sync-js

Keywords

FAQs

Package last updated on 27 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc