-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vn(feat) wrap: and reminder: rubberduck, dont walk in circles, take a…
… step back, be kind to yourself, people are doing their jobs everyday and you're looking to do something like this for months now
- Loading branch information
1 parent
ae963d3
commit 8f57cc5
Showing
18 changed files
with
261 additions
and
189 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
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
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
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,65 @@ | ||
// actions.d.ts | ||
import type { Context } from "react"; | ||
export type ActionT = "login" | "logout" | "hydrate" | "update_db"; | ||
export type ActionTypes = "auth" | "rickmorty"; | ||
export type ActionAuthNames = | ||
| "load user" | ||
| "unload user" | ||
| "load characters" | ||
| "unload characters" | ||
| "decorate characters" | ||
| "add char to favorites"; | ||
|
||
export type ISupportedContexts = IAuthContext | IRMContext | ILogContext; | ||
|
||
export interface IActionBack { | ||
action?: ActionT; | ||
type?: ActionTypes; | ||
verb?: ActionAuthNames; | ||
context: Context<ISupportedContexts>; | ||
} | ||
|
||
export interface IAction { | ||
cb?: Array<() => void>; | ||
} | ||
|
||
export interface IStatus { | ||
str: string; | ||
ok: boolean | undefined; | ||
current: string; | ||
} | ||
|
||
export interface IALoginPayload { | ||
name?: string; | ||
avatar?: string; | ||
authd?: boolean; | ||
setter?: () => void; | ||
email?: string; | ||
} | ||
|
||
export interface IDAddToFavPayload { | ||
email: string; | ||
cid: number; | ||
} | ||
|
||
export interface IACharacterPayload { | ||
characters?: INCharacter[]; | ||
setter?: () => void; | ||
cid?: number; | ||
} | ||
|
||
export type ICreateAction = ( | ||
options: IActionBack, | ||
) => (_options: IAction) => [boolean | undefined, IDispatch]; | ||
|
||
export type IAPayload = IALoginPayload | IACharacterPayload; | ||
export type IDPayload = IDAddToFavPayload; | ||
export type _IPayload = IAPayload | IDPayload; | ||
export interface IDispatchPayload { | ||
payload?: IAPayload | IDPayload; | ||
func?: IDispatch; | ||
} | ||
|
||
export type IPayload = [IDispatchPayload[], IDispatch]; | ||
|
||
export type IDispatch = (...payload: IPayloadF) => void | Promise<void>; |
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
Oops, something went wrong.