Make ConfigObserver a proper mixin and export it

This commit is contained in:
Nathan Sobo 2014-01-21 20:56:23 -07:00
parent b380551e5e
commit 8ca8ac5efc
4 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,7 @@ module.exports =
File: require '../src/file'
fs: require 'fs-plus'
Git: require '../src/git'
ConfigObserver: require '../src/config-observer'
Point: Point
Range: Range

View File

@ -1,4 +1,7 @@
Mixin = require 'mixto'
module.exports =
class ConfigObserver extends Mixin
observeConfig: (keyPath, args...) ->
@configSubscriptions ?= {}
@configSubscriptions[keyPath] = atom.config.observe(keyPath, args...)

View File

@ -15,7 +15,7 @@ ConfigObserver = require './config-observer'
module.exports =
class DisplayBuffer extends Model
Serializable.includeInto(this)
_.extend @prototype, ConfigObserver
ConfigObserver.includeInto(this)
@properties
softWrap: null

View File

@ -1,9 +1,9 @@
_ = require 'underscore-plus'
spacePen = require 'space-pen'
ConfigObserver = require './config-observer'
{Subscriber} = require 'emissary'
ConfigObserver = require './config-observer'
_.extend spacePen.View.prototype, ConfigObserver
ConfigObserver.includeInto(spacePen.View)
Subscriber.includeInto(spacePen.View)
jQuery = spacePen.jQuery