Alokai

ConfigState

Accessors and mutators for per-request state (cart, country, currency, customer token, locale, store and messages), typically backed by cookies.

type ConfigState = {
  getCartId(): string;
  getCountry(): string;
  getCurrency(): string;
  getCustomerToken(): string;
  getLocale(): string;
  getMessage<T>(): T;
  getStore(): string;
  removeCartId(): void;
  removeCountry(): void;
  removeCurrency(): void;
  removeCustomerToken(): void;
  removeLocale(): void;
  removeMessage(): void;
  removeStore(): void;
  setCartId(id?: null | string): void;
  setCountry(id?: null | string): void;
  setCurrency(id?: null | string): void;
  setCustomerToken(token?: null | string): void;
  setLocale(id?: null | string): void;
  setMessage<T>(id?: null | T): void;
  setStore(id?: null | string): void;
};