Project

General

Profile

« Previous | Next » 

Revision c17cfcee

Added by Amir Fefer almost 3 years ago

Fixes #33153 - make slot registry singleton

View differences:

webpack/assets/javascripts/react_app/components/common/Slot/SlotSelectors.js
import { getSlotComponents } from '../../../../services/SlotsRegistry';
import SlotsRegistry from '../../../../services/SlotsRegistry';
export const selectComponentByWeight = slotId =>
getSlotComponents(slotId)
SlotsRegistry.getSlotComponents(slotId)
.sort((a, b) => b.weight - a.weight)
.map(c => c.component) || {};
......
if (selectFillsAmount(state, id)) {
if (fillID) {
const slotComponent = getSlotComponents(id);
const slotComponent = SlotsRegistry.getSlotComponents(id);
const getFill = slotComponent.filter(c => c.id === fillID);
return [getFill[0].component];

Also available in: Unified diff