Skip to content

Commit

Permalink
Using an arrow function instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ngbrown committed May 6, 2023
1 parent fbd571d commit 1c59001
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions packages/remix-server-runtime/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,31 @@ export interface SessionStorage<Data = SessionData, FlashData = Data> {
* Session. If there is no session associated with the cookie, this will
* return a new Session with no data.
*/
getSession(
getSession: (
this: void,
cookieHeader?: string | null,
options?: CookieParseOptions
): Promise<Session<Data, FlashData>>;
) => Promise<Session<Data, FlashData>>;

/**
* Stores all data in the Session and returns the Set-Cookie header to be
* used in the HTTP response.
*/
commitSession(
commitSession: (
this: void,
session: Session<Data, FlashData>,
options?: CookieSerializeOptions
): Promise<string>;
) => Promise<string>;

/**
* Deletes all data associated with the Session and returns the Set-Cookie
* header to be used in the HTTP response.
*/
destroySession(
destroySession: (
this: void,
session: Session<Data, FlashData>,
options?: CookieSerializeOptions
): Promise<string>;
) => Promise<string>;
}

/**
Expand All @@ -224,24 +224,19 @@ export interface SessionIdStorageStrategy<
* Creates a new record with the given data and returns the session id.
*/
createData: (
this: void,
data: FlashSessionData<Data, FlashData>,
expires?: Date
) => Promise<string>;

/**
* Returns data for a given session id, or `null` if there isn't any.
*/
readData: (
this: void,
id: string
) => Promise<FlashSessionData<Data, FlashData> | null>;
readData: (id: string) => Promise<FlashSessionData<Data, FlashData> | null>;

/**
* Updates data for the given session id.
*/
updateData: (
this: void,
id: string,
data: FlashSessionData<Data, FlashData>,
expires?: Date
Expand All @@ -250,7 +245,7 @@ export interface SessionIdStorageStrategy<
/**
* Deletes data for a given session id from the data store.
*/
deleteData: (this: void, id: string) => Promise<void>;
deleteData: (id: string) => Promise<void>;
}

export type CreateSessionStorageFunction = <
Expand Down

0 comments on commit 1c59001

Please sign in to comment.