github.com/emate/nomad@v0.8.2-wo-binpacking/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] || 1; 18 }, 19 20 setIndexFor(url, value) { 21 list[url] = value; 22 }, 23 });