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/Fill/FillActions.js
import { REGISTER_FILL, REMOVE_FILLED_COMPONENT } from './FillConstants';
import { add, remove } from '../../../../services/SlotsRegistry';
import SlotsRegistry from '../../../../services/SlotsRegistry';
export const registerFillComponent = (
slotId,
......
component,
weight
) => dispatch => {
add(slotId, fillId, component, weight, overrideProps);
SlotsRegistry.add(slotId, fillId, component, weight, overrideProps);
dispatch({
type: REGISTER_FILL,
payload: { slotId, fillId, weight },
......
};
export const unregisterFillComponent = (slotId, fillId) => dispatch => {
remove(slotId, fillId);
SlotsRegistry.remove(slotId, fillId);
dispatch({
type: REMOVE_FILLED_COMPONENT,
payload: { slotId },

Also available in: Unified diff