
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Store class for facebook flux, generates event methods automatically, more simple dispatch listener
Store class for facebook flux, generates event methods automatically, more simple dispatch listener
Generates for you these methods:
addYourEventListener, removeYourEventListener, emitYourEvent
With this module you can write store this way::
const AppDispatcher = require('../dispatcher/app_dispatcher');
const SampleConstants = require('../constants/sample_constants');
const FluxStore = require('fluxstore')
class SampleStore extends FluxStore {
getEvents() {
return ['create', 'change', 'createError', 'addTag'];
}
create(data) {
// ...
}
addTag(linkId, tag) {
// ...
}
getAll() {
// ...
}
destroy(link) {
// ...
}
connections(connect) {
connect(SampleConstants.SAMPLE_CREATE, (action) => {
this.create(action.data);
this.emitChange();
this.emitCreate();
});
connect(SampleConstants.SAMPLE_CREATE_ERROR, this.emitCreateError);
connect(SampleConstants.SAMPLE_DESTROY, this.destroy);
connect(SampleConstants.SAMPLE_ADD_TAG, ({link, tag}) => {
this.addTag(link.id, tag);
this.emitChange();
this.emitAddTag();
});
}
};
let store = new SampleStore(AppDispatcher);
module.exports = store;
and in your component:
var SampleComponent = React.createClass({
/// ...
componentDidMount: function() {
SampleStore.addChangePathListener(this._onChangePath);
SampleStore.addAddTagListener(this._onAddTag);
SampleStore.addMobileUpdateListener(this._onMobileUpdate);
},
componentWillUnmount: function() {
SampleStore.removeChangePathListener(this._onChangePath);
SampleStore.removeAddTagListener(this._onAddTag);
SampleStore.removeMobileUpdateListener(this._onMobileUpdate);
},
/// ...
})
FAQs
Store class for facebook flux, generates event methods automatically, more simple dispatch listener
We found that fluxstore2 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.