Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
flux-commons-store
Advanced tools
Modular, isolated and tested Store class compatible with the facebook/flux dispatcher (https://github.com/facebook/flux).
In contrast with other Flux libraries the idea with flux-commons is to provide small plugable utils/classes or patterns to use in a Flux application.
Favor object matching and custom matchers over 'String' comparison. When a Flux app starts to grow lots of edge cases end up being very messy and result in a massive amount of strings and constants.
{action: action, params: params}
, therefore for this Store to behave properly with listeners and custom matchers we need that actions dispatched through the dispatcher respect that format. (This is going to be change in favor of a flexible approach in the near future).The idea behind this small module was to be able to have a simple API as follows:
// Match specific actions
myStore.listenToAction(Actions.fetchItems, handleFetchingItems);
myStore.listenToAction(Actions.fetchItems.done, handleFetchingItemsDone);
myStore.listenToAction(Actions.fetchItems.fail, handleFetchingItemsFail);
// Generic matchers
var unauthorizedMatcher = (action, params) => params.response.status === 401;
myStore.listenToMatchingAction(unauthorized, handleUnauthorized);
.listenToAction(action, handler)
.listenToMatchingAction(matcher, handler)
action
and the parms
when performing the match..addChangeListener(callback)
.removeChangeListener(callback)
.emitChange()
Emits a change event and executes the callbacks registered (if any)
var Store = require('flux-commons-store');
var appDispatcher = require('./app_dispatcher'); // Facebook Dispatcher
class MyStore extends Store {
// My custom methods for this store
}
// The Store will automatically register itself
// against the Dispatcher provided.
var myStore = new MyStore(appDispatcher);
FAQs
Base Store class to use with Flux/Dispatcher
The npm package flux-commons-store receives a total of 0 weekly downloads. As such, flux-commons-store popularity was classified as not popular.
We found that flux-commons-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.