-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add zustand and create an unused sessionStore.
- Loading branch information
Showing
10 changed files
with
86 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// Consider using Recoil instead of Context? | ||
import React from 'react' | ||
|
||
export interface Account { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import create from 'zustand' | ||
import { Certificate } from '../minecraft/api/mojang' | ||
|
||
export interface Session { | ||
certificate?: Certificate | ||
accessToken: string | ||
} | ||
|
||
export interface Sessions { | ||
[uuid: string]: Session | ||
} | ||
|
||
export type SetSession = (uuid: string, session: Session) => void | ||
|
||
const useSessionStore = create<{ | ||
sessions: Sessions | ||
setSession: SetSession | ||
}>(set => ({ | ||
sessions: {}, | ||
setSession: (uuid: string, session: Session) => | ||
set(state => ({ sessions: { ...state.sessions, [uuid]: session } })) | ||
})) | ||
|
||
export default useSessionStore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// Consider using Recoil instead of Context? | ||
import React from 'react' | ||
|
||
export interface Settings { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7129,7 +7129,7 @@ | |
"react-shallow-renderer" "^16.13.1" | ||
"scheduler" "^0.21.0" | ||
|
||
"react@*", "react@^16.0.0 || ^17.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.0", "react@^18.0.0", "react@16 || 17", "[email protected]": | ||
"react@*", "react@^16.0.0 || ^17.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.0", "react@^18.0.0", "react@>=16.8", "react@16 || 17", "[email protected]": | ||
"integrity" "sha512-x+VL6wbT4JRVPm7EGxXhZ8w8LTROaxPXOqhlGyVSrv0sB1jkyFGgXxJ8LVoPRLvPR6/CIZGFmfzqUa2NYeMr2A==" | ||
"resolved" "https://registry.npmjs.org/react/-/react-18.0.0.tgz" | ||
"version" "18.0.0" | ||
|
@@ -8365,7 +8365,7 @@ | |
"resolved" "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" | ||
"version" "0.1.0" | ||
|
||
"use-sync-external-store@^1.0.0": | ||
"use-sync-external-store@^1.0.0", "[email protected]": | ||
"integrity" "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==" | ||
"resolved" "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz" | ||
"version" "1.2.0" | ||
|
@@ -8719,3 +8719,10 @@ | |
"string-width" "^4.2.0" | ||
"y18n" "^5.0.5" | ||
"yargs-parser" "^20.2.2" | ||
|
||
"zustand@^4.0.0-rc.3": | ||
"integrity" "sha512-vc7TKQJC6T8lx5EupnuUTWXahuRLYjrK9oWLvY+u65ZkLDjocgxDGMrl5VBuxyjXCXyJ3kquN3l/Y2yUj5ZDEg==" | ||
"resolved" "https://registry.npmjs.org/zustand/-/zustand-4.0.0-rc.3.tgz" | ||
"version" "4.0.0-rc.3" | ||
dependencies: | ||
"use-sync-external-store" "1.2.0" |