Files
baya-monorepo/client/src/services/notifications/apis/index.ts
T
2026-07-10 18:46:16 +03:30

14 lines
628 B
TypeScript

import { USE_NOTIFICATIONS_MOCK } from '../constants';
import type { NotificationsApi } from '../types';
import { notificationsClientApi } from './clientApi';
import { notificationsMockApi } from './mockApi';
/**
* The selected `NotificationsApi` implementation — the single seam the hooks import. Selection is by config
* (`USE_NOTIFICATIONS_MOCK`), never scattered `if (mock)` checks. Mock-primary this phase (nothing dispatches
* notifications client-side yet); the swap is this one line.
*/
export const notificationsApi: NotificationsApi = USE_NOTIFICATIONS_MOCK
? notificationsMockApi
: notificationsClientApi;