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
// Router class | |
import type { APIContext } from "astro"; | |
type Method = "GET" | "POST" | "PUT" | "DELETE"; | |
type Route = { | |
method: Method; | |
uri: string; | |
callbacks: Array<(context?: APIContext) => any>; | |
}; |
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
What this is about? | |
Ans: i am building an music application that takes an config file, that will have a unified schema design and endpoints user can use, the endpoints and their responses can be different for each user, to make it simple i was thinking of making a parsing system, and then parse and use the endpoints and use mappings values to map responses according to our classes/models | |
there will be other endpoints for song, playlist, album, search, genre | |
Depending on the endpoints user provides , we show certain ui widgets, | |
The home,song,playlist endpoint are required | |
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
// store.ts | |
import { | |
configureStore, | |
AnyAction, | |
TypedStartListening, | |
TypedAddListener, | |
addListener, | |
} from "@reduxjs/toolkit"; | |
import { | |
FLUSH, |