
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
A Flux Store implementation, designed for ease and safety
var Coherence = require('coherence');
function AnimalStore(dependencies) {
var coherence = Coherence({dispatcher: dependencies.dispatcher});
var animalData = MyAnimalDataSource();
coherence.registerHandler('speak', speak);
coherence.registerRoute('/animals/:animalId', show);
function speak(action) {
coherence.set({words: action.words});
}
function show(path, params) {
animalData.fetch(params.animalId)
.then(function(animal) {
coherence.set({currentAnimal: animal});
});
}
return coherence.fluxSafe();
}
AnimalStore.singleton = AnimalStore({dispatcher: appDispatcher});
module.exports = AnimalStore;
var animalStore = require('./animal_store').singleton;
var AnimalView = React.createClass({
componentWillMount: function() {
animalStore.addChangeListener(this.updateState);
},
componentWillUnmount: function() {
animalStore.removeChangeListener(this.updateState);
},
updateState: function() {
this.setState({animalData: animalStore.data()});
},
render: function() {
return (<div>...</div>);
}
});
Coherence exposes a two-layered API.
The first layer exposes "unsafe" methods, that should only be used inside your Store class. These methods allow you to define the behavior of your Store, in terms of:
The second layer is comprised of the methods intended for external use (e.g. by
React Components). These are returned by fluxSafe:
"Routing" with Coherence, is really just a wrapper around action handling, with route matching and param parsing baked in (via dumb-router).
Registered routes listen for Actions with a type of
Coherence.NAVIGATE_ACTION_TYPE, and with a path property.
To trigger your routes:
yourDispatcher.dispatch({
type: Coherence.NAVIGATE_ACTION_TYPE,
path: whereYouWantToGo,
});
registerRoute(routeString, routeHandler)
handleAction(actionType, actionHandler)
set(newValues)
.fluxSafe().data(), and triggers the event
handlers bound by .fluxSafe().addChangeListener()addChangeListener(callback)
coherence.set is called,
for use when mounting controller componentsremoveChangeListener(callback)
data()
coherence.setpath(...pathParts)
coherence.registerRoute - see
dumb-router for
more informationAdd or modify tests to reflect the change you want.
Run them with npm test, and update the code in src/ till your tests pass.
Running the tests will run npm run compile, which outputs the code as ES5,
polyfilled via core-js.
FAQs
Flux-inspired Models and Intents, for React apps
The npm package coherence receives a total of 32 weekly downloads. As such, coherence popularity was classified as not popular.
We found that coherence 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.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.