FamousInternal/inputs — pull request #2 by dmvaldman (2014-05-07 01:58:40+00:00)
Title: Develop generic sync

Examples.git on the develop-genericSync branch has example usage.

### Changelog:

Refactors:
- `GenericSync` has a global registry, similar to `Transitionable`. For security, this registry is append only. Syncs can be registered app wide with a key, and referred to by this key. E.g,

```
// In main.js
GenericSync.register({
mouse : MouseSync,
touch : TouchSync
})

// In myModule.js
this.sync = new GenericSync(['mouse', 'touch']);

//...or, if options are necessary

this.sync = new GenericSync({
'mouse' : {options},
'touch' : {options}
});
```

- Other syncs have all been cleaned up to current code standards. `targetGet` is removed. Syncs provide deltas, in addition to an absolute displacement, however the best practice is to pipe them to an `Accumulator`.

Additions:
- `Accumulator` has an `eventInput` and a `set` and `get` method. Any number of syncs that emits a `delta` key can pipe to an `Accumulator` which has the basic ability to sum the differentials, and set a baseline value by calling `set`. Its `eventInput` defaults to listening to `update`, but this can be specified, and can be extended to listen to multiple event types.