Ghost/ghost/admin/app/utils/computed-fallback-if-undefined.js
Kevin Ansfield 7c7c4962f9 Upgraded ember-power-* addons (#1459)
no issue

- bump deps
- adjust usage for breaking changes... 
  - https://github.com/cibernox/ember-power-select/blob/master/CHANGELOG.md#300-beta1
  - https://github.com/cibernox/ember-basic-dropdown/blob/master/CHANGELOG.md#200-beta3
  - https://github.com/cibernox/ember-power-datepicker/blob/master/CHANGELOG.md#070
- update overridden component and template files to match latest addon code
  - switch to class syntax w/decorators
  - adjust for angle bracket syntax
2020-01-15 13:53:51 +00:00

14 lines
275 B
JavaScript

import {computed} from '@ember/object';
export default function computedFallbackIfUndefined(fallback) {
return computed({
get() {
return fallback;
},
set(_, v) {
return v === undefined ? fallback : v;
}
});
}