Skip to content

_changes and _db_updates

Compare
Choose a tag to compare
@ampatspell ampatspell released this 18 Jun 00:19
· 253 commits to master since this release
// sofa/changes/all.js
import { DatabaseChanges } from 'sofa';

export default DatabaseChanges.extend({
  feed: [ 'event-source', 'long-polling' ]
});
let changes = db.changes('all');
changs.on('change', change => console.log(change));
changes.start();

see portfolio app for an example: https://github.com/ampatspell/portfolio/blob/changes-listener/app/instance-initializers/portfolio-changes.js