2023-03-14 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-14 13:18:55 +00:00
|
|
|
*/
|
|
|
|
|
2021-09-22 17:26:36 +00:00
|
|
|
import Helper from '@ember/component/helper';
|
|
|
|
import { getOwner } from '@ember/application';
|
|
|
|
|
|
|
|
export default class CachedHelper extends Helper {
|
2021-10-26 18:26:04 +00:00
|
|
|
compute([model, params], hash) {
|
|
|
|
const container = getOwner(this);
|
|
|
|
return container.lookup(`service:repository/${model}`).cached(params);
|
2021-09-22 17:26:36 +00:00
|
|
|
}
|
|
|
|
}
|