github.com/hspak/nomad@v0.7.2-0.20180309000617-bc4ae22a39a5/ui/app/services/watch-list.js (about) 1 import { readOnly } from '@ember/object/computed'; 2 import { copy } from '@ember/object/internals'; 3 import Service from '@ember/service'; 4 5 let list = {}; 6 7 export default Service.extend({ 8 list: readOnly(function() { 9 return copy(list, true); 10 }), 11 12 init() { 13 list = {}; 14 }, 15 16 getIndexFor(url) { 17 return list[url] || 0; 18 }, 19 20 setIndexFor(url, value) { 21 list[url] = value; 22 }, 23 });