mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
14 lines
275 B
JavaScript
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;
|
||
|
}
|
||
|
});
|
||
|
}
|