Skip to content

Commit

Permalink
refactor(remix-server-runtime): expose SessionStorage's methods as …
Browse files Browse the repository at this point in the history
…arrow functions (#6330)
  • Loading branch information
ngbrown authored May 15, 2023
1 parent 9de3c4b commit dcd7c2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-garlics-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/server-runtime": patch
---

Expose methods in the `SessionStorage` interface as arrow functions so destructuring is correctly part of the contract.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
- nareshbhatia
- navid-kalaei
- nexxeln
- ngbrown
- ni554n
- nicholaschiang
- nicksrandall
Expand Down
12 changes: 6 additions & 6 deletions packages/remix-server-runtime/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,28 +174,28 @@ 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: (
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: (
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: (
session: Session<Data, FlashData>,
options?: CookieSerializeOptions
): Promise<string>;
) => Promise<string>;
}

/**
Expand Down

0 comments on commit dcd7c2e

Please sign in to comment.