2018-02-08 23:06:10 +00:00
|
|
|
import { readOnly } from '@ember/object/computed';
|
|
|
|
import { copy } from '@ember/object/internals';
|
|
|
|
import Service from '@ember/service';
|
|
|
|
|
2018-02-17 02:59:40 +00:00
|
|
|
let list = {};
|
2018-02-08 23:06:10 +00:00
|
|
|
|
|
|
|
export default Service.extend({
|
|
|
|
list: readOnly(function() {
|
|
|
|
return copy(list, true);
|
|
|
|
}),
|
|
|
|
|
2018-02-17 02:59:40 +00:00
|
|
|
init() {
|
|
|
|
list = {};
|
|
|
|
},
|
|
|
|
|
2018-02-08 23:06:10 +00:00
|
|
|
getIndexFor(url) {
|
2018-03-21 20:28:56 +00:00
|
|
|
return list[url] || 1;
|
2018-02-08 23:06:10 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setIndexFor(url, value) {
|
|
|
|
list[url] = value;
|
|
|
|
},
|
|
|
|
});
|