84c977faf1
* Add uniq-by helper * Pass unique services through to intentions form * Add acceptance test
14 lines
303 B
JavaScript
14 lines
303 B
JavaScript
import { helper } from '@ember/component/helper';
|
|
import { isEmpty } from '@ember/utils';
|
|
import { A as emberArray } from '@ember/array';
|
|
|
|
export function uniqBy([byPath, array]) {
|
|
if (isEmpty(byPath)) {
|
|
return [];
|
|
}
|
|
|
|
return emberArray(array).uniqBy(byPath);
|
|
}
|
|
|
|
export default helper(uniqBy);
|