Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-honig committed Apr 18, 2024
1 parent b73ab14 commit 9de4121
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions misc/public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,22 @@ export interface ApiClient {
*
* @example
* // Adding bearer token authorization
* remult.apiClient.httpClient = (input: RequestInfo | URL, init?: RequestInit) => {
* remult.apiClient.httpClient = (
* input: RequestInfo | URL,
* init?: RequestInit
* ) => {
* return fetch(input, {
* ...init,
* headers: {
* authorization: 'Bearer ' + sessionStorage.sessionId,
* },
* headers: authToken
* ? {
* ...init?.headers,
* authorization: 'Bearer ' + authToken,
* }
* : init?.headers,
*
* cache: 'no-store',
* });
* };
* })
* }
*/
httpClient?: ExternalHttpProvider | typeof fetch
/**
Expand Down Expand Up @@ -1873,7 +1880,7 @@ export declare class Remult {
* @param entity - the entity to use
* @param dataProvider - an optional alternative data provider to use. Useful for writing to offline storage or an alternative data provider
*/
repo<T>(entity: ClassType<T>, dataProvider?: DataProvider): Repository<T>
repo: <T>(entity: ClassType<T>, dataProvider?: DataProvider) => Repository<T>
/** Returns the current user's info */
user?: UserInfo
/** Checks if a user was authenticated */
Expand Down

0 comments on commit 9de4121

Please sign in to comment.