UNPKG

@commercetools-frontend/sdk

Version:
11 lines (10 loc) 565 B
/// <reference types="commercetools__sdk-client" /> import type { Dispatch, MiddlewareAPI } from 'redux'; import type { TSdkAction } from '../types'; export default function createSdkMiddleware({ getCorrelationId, getProjectKey, getAdditionalHeaders, }: { getCorrelationId: () => string; getProjectKey: () => string | undefined; getAdditionalHeaders: () => { [key: string]: string; } | undefined; }): ({ dispatch }: MiddlewareAPI) => (next: Dispatch<TSdkAction>) => (action: TSdkAction) => Promise<import("@commercetools/sdk-client").Json>;