Syphon, json-schema-benchmark

2015-02-02 00:00:00 +0000 by Alex R. Young


Syphon (GitHub: scttnlsn/syphon, License: MIT, npm: syphon) by Scott Nelson is an implementation of the Flux architectural pattern for React. It helps you to structure applications around a single immutable state value, and implements the dispatching of actions to various state-transitioning handler functions.

The application's state is stored in an immutable data structure that you create with the atom method. To access a value, you deref it, and you can also modify it by using swap:

var state = syphon.atom({ foo: 'bar' });

state.swap(function(current) {

  return current.set('foo', 'baz');

// => { foo: 'baz' }

Responding to state changes involves writing handlers, which takes the form of functions with two arguments: value and currentState. The application's state is available in the second argument.

Syphon's author recommends using the multimethod module to deal with handlers that branch on multiple values.

Syphon includes the root method for mounting your component hierarchy, and a mixin for adding helpers to components for accessing application data and dispatch values.


I may need to create some JSON schemas in the near future, so it was fortunate that Allan Ebdrup sent in json-schema-benchmark. This is a benchmark for JSON schema validators, and covers the following modules:

It also shows test failures when run against the official JSON Schema Test Suite. One cool addition is a summary of tests that caused side-effects, so you can see which validators altered values.