
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.
Flux inspired Models and Controllers, for your React app.
// animals-model.js
var Model = require('coherence').Model;
var Animals = function(dependencies) {
var getAnimalAsync = dependencies.getAnimalAsync;
var model = Model(function(expose, def) {
// define bindable state
var currentAnimal = expose('currentAnimal');
var said = expose('said');
// define methods to change that state
def('select', function(animalId) {
getAnimalAsync.then(function(animal) {
currentAnimal.onNext(animal);
});
});
def('say', function(words) {
said.onNext(words);
});
});
return model;
};
Animals.instance = Animals({
getAnimalsAsync: require('...'),
});
module.exports = Animals;
// animals-controller.js
var Controller = require('coherence').Controller;
function AnimalsController(dependencies) {
var animals = dependencies.animals;
var manager = Controller(dependencies.dispatcher, function(router, intents) {
router.register('/animals/:animalId', showAnimal);
intents.register('speak', speak);
// action handler
function speak(action) {
dependencies.animals.say(action.words);
}
// route handler
function show(path, params) {
dependencies.animals.select(params.animalId);
});
return store;
};
AnimalStore.instance = AnimalStore({
dispatcher: require('./my-app-dispatcher'),
animals: require('./animals-model').instance,
});
module.exports = AnimalStore;
var animalStore = require('./animal_store').instance;
var AnimalView = React.createClass({
componentWillMount: function() {
var animals = require('./animals-model').instance;
this.animalBindings = animals.ReactBindings(this, animals, {
animalData: 'currentAnimal',
animalSays: 'says',
});
},
componentWillUnmount: function() {
this.animalBindings.unbind();
},
render: function() {
return (
<div>
<AnimalData data={this.state.animalData} />
<p>Animal says: {this.state.animalSays}</p>
</div>
);
}
});
"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,
});
var store = Coherence(dispatcher, function(router, intents) {
/* define store behavior here */
});
The Coherence function takes two arguments:
dispatcher
register method that conforms to the semantics described by
Fluxconfigurer
a callback, that accepts three arguments, used together to define the behavior of the returned store instance
router.register(routeString, routeHandler)
path string,
and a params objectactions.register(actionType, actionHandler)
Within the context of a React class definition:
this.subscriptions = store.subscribe(this, bindingNames)
subject.set is called.this is the React componentbindingNames can be either be
this.subscriptions.unsubscribe()
store.subscribe. Call this from
componentWillUnmountstore.path(...pathParts)
router.register - 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 0 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.