Mailspring/src/database-object-registry.coffee
Ben Gotow 528c8850ce bump(electron): 0.34.3 => 0.35.1
Electron 0.35.1 includes the tray fixes we contributed last week but also includes API restructuring and improvements. Most importantly, modules from electron are now imported via `require('electron')`
2015-11-23 22:09:17 -08:00

17 lines
479 B
CoffeeScript

_ = require 'underscore'
Model = null
SerializableRegistry = require './serializable-registry'
class DatabaseObjectRegistry extends SerializableRegistry
classMap: -> return @_constructors
register: (constructor) ->
Model ?= require './flux/models/model'
if constructor?.prototype instanceof Model
super
else
throw new Error("You must register a Database Object class with this registry", constructor)
module.exports = new DatabaseObjectRegistry()