You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/app/services/data-source/protocols/local-storage.js

18 lines
436 B

import Service, { inject as service } from '@ember/service';
import { StorageEventSource } from 'consul-ui/utils/dom/event-source';
export default Service.extend({
repo: service('settings'),
source: function(src, configuration) {
const slug = src.split(':').pop();
return new StorageEventSource(
configuration => {
return this.repo.findBySlug(slug);
},
{
key: src,
}
);
},
});