UNPKG

428 Btext/coffeescriptView Raw
1_ = require 'lodash'
2ChannelDownloader = require './channel-downloader'
3
4# outside the class so cache is maintained
5Downloader = new ChannelDownloader
6
7class ChannelConfig
8 constructor: (options) ->
9 Downloader.setOptions options
10
11 get: (type) =>
12 _.findWhere @channels, type: type
13
14 update: (callback) =>
15 Downloader.update (error, @channels) =>
16 callback error
17
18module.exports = ChannelConfig