How to use ts-deepmerge - 5 common examples

To help you get started, we’ve selected a few ts-deepmerge 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 voodoocreation / react-redux-boilerplate / src / utilities / WrapperWithRedux.tsx View on Github external
protected createStore(
    initialState: DeepPartial<s>,
    middlewares: Middleware[]
  ) {
    this.mergedPorts = configureTestPorts(
      merge(this.defaultPorts, this.scenarioPorts) as ITestPortsParam
    );

    return configureStore(
      merge(rootInitialState, initialState) as TStoreState,
      this.mergedPorts as IPorts,
      middlewares
    );
  }
</s>
github voodoocreation / react-redux-boilerplate / src / utilities / SagaTester.ts View on Github external
constructor(
    reduxState: DeepPartial = {},
    ports: ITestPortsParam = {}
  ) {
    this.tester = new ReduxSagaTester({
      initialState: merge(initialState, reduxState),
      reducers: rootReducer
    });

    this.ports = configureTestPorts(ports);

    this.tester.start(rootSaga, (this.ports as unknown) as IPorts);
  }
github voodoocreation / react-redux-boilerplate / src / utilities / MockPageContext.ts View on Github external
public toObject = (isServer = false) => {
    this.dispatchedActions = [];
    this.store = configureStore(
      merge({}, rootInitialState, this.defaultReduxState, this.reduxState),
      configureTestPorts({}),
      [this.reduxHistoryMiddleware]
    );
    const err = this.error || this.defaultError;
    const query = merge({}, this.defaultQuery, this.query);
    const res = this.response || this.defaultResponse;

    this.error = undefined;
    this.query = {};
    this.reduxState = {};
    this.response = undefined;

    return {
      err,
      isServer,
      query,
github voodoocreation / react-redux-boilerplate / src / utilities / WrapperWithRedux.tsx View on Github external
protected createStore(
    initialState: DeepPartial<s>,
    middlewares: Middleware[]
  ) {
    this.mergedPorts = configureTestPorts(
      merge(this.defaultPorts, this.scenarioPorts) as ITestPortsParam
    );

    return configureStore(
      merge(rootInitialState, initialState) as TStoreState,
      this.mergedPorts as IPorts,
      middlewares
    );
  }
</s>
github voodoocreation / react-redux-boilerplate / src / utilities / MockPageContext.ts View on Github external
public toObject = (isServer = false) => {
    this.dispatchedActions = [];
    this.store = configureStore(
      merge({}, rootInitialState, this.defaultReduxState, this.reduxState),
      configureTestPorts({}),
      [this.reduxHistoryMiddleware]
    );
    const err = this.error || this.defaultError;
    const query = merge({}, this.defaultQuery, this.query);
    const res = this.response || this.defaultResponse;

    this.error = undefined;
    this.query = {};
    this.reduxState = {};
    this.response = undefined;

    return {
      err,
      isServer,
      query,
      res,
      store: this.store
    } as any;
  };

ts-deepmerge

A TypeScript deep merge function.

ISC
Latest version published 1 month ago

Package Health Score

79 / 100
Full package analysis

Popular ts-deepmerge functions