How to use the timm.mergeDeep function in timm

To help you get started, we’ve selected a few timm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ThemeFuse / Brizy / public / editor-src / editor / js / redux / actions.js View on Github external
return (dispatch, getState) => {
    const fonts = fontSelector(getState());
    const fontData = (fonts[type] && fonts[type].data) || [];
    const dataFonts = {
      [`${type}`]: {
        data: fontData.map(font =>
          removedFonts.some(({ brizyId }) => brizyId === font.brizyId)
            ? { ...font, deleted: true }
            : font
        )
      }
    };

    return dispatch({
      type: DELETE_FONTS,
      payload: mergeDeep(fonts, dataFonts)
    });
  };
}
github ThemeFuse / Brizy / public / editor-src / editor / js / redux / actions.js View on Github external
...acc,
        [`${type}`]: {
          data: fontData
            .map(
              font =>
                deletedFonts.find(({ brizyId }) => font.brizyId === brizyId) ||
                font
            )
            .concat(newFonts)
        }
      };
    }, {});

    return dispatch({
      type: ADD_FONTS,
      payload: mergeDeep(usedFonts, newFonts)
    });
  };
}