Ronald 9d21736e9f
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

26 lines
565 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Service, { inject as service } from '@ember/service';
import { StorageEventSource } from 'consul-ui/utils/dom/event-source';
export default class LocalStorageService extends Service {
@service('settings')
repo;
source(src, configuration) {
const slug = src.split(':').pop();
return new StorageEventSource(
(configuration) => {
return this.repo.findBySlug(slug);
},
{
key: src,
uri: configuration.uri,
}
);
}
}