You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/lib/block-slots/addon/mixins/slots.js

18 lines
431 B

import { computed, get } from '@ember/object';
import { A } from '@ember/array';
import Mixin from '@ember/object/mixin';
export default Mixin.create({
_slots: computed(function() {
return A();
}),
_activateSlot(name) {
get(this, '_slots').addObject(name);
},
_deactivateSlot(name) {
get(this, '_slots').removeObject(name);
},
_isRegistered(name) {
return get(this, '_slots').includes(name);
},
});