github.com/manicqin/nomad@v0.9.5/ui/app/services/watch-list.js (about) 1 import { readOnly } from '@ember/object/computed'; 2 import { copy } from 'ember-copy'; 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 this._super(...arguments); 14 list = {}; 15 }, 16 17 getIndexFor(url) { 18 return list[url] || 1; 19 }, 20 21 setIndexFor(url, value) { 22 list[url] = +value; 23 }, 24 });