Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flux-commons-store-watch-mixin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flux-commons-store-watch-mixin

Simple mixin for binding your component to the store changes

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Flux Commons Store Watch Mixin

Simple mixin for registering/unregistering automatically a component to the change events on a store.

Usage

var StoreWatchMixin = require('./mixins/store_watch_mixin');
var MyStore = require('./my_store');

var Component = React.createClass({
  mixins: [StoreWatchMixin(MyStore)],

  render: function() {...}

})

By default will assume that your stores have the methods addChangeListener removeChangeListener and your components the method onStoreChange. If you don't like the defaults you can change them by sending an options object as the second argument of the StoreWatchMixin.

Available options

  • addListenerFnName name of the register function on the Store.
  • removeListenerFnName name of the unregister function on the Store.
  • handlerName name of the handler that will be executed on the component when a store emits a change event.

Keywords

FAQs

Package last updated on 18 Feb 2015

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