Refactor
This commit is contained in:
parent
83b8c86cac
commit
6ad2721831
|
@ -6,11 +6,14 @@ interface JellyfinApiResponse {
|
|||
StartIndex?: number,
|
||||
};
|
||||
|
||||
const init = async () => {
|
||||
const response: JellyfinApiResponse = await fetchFromApi();
|
||||
const { Items: items, TotalRecordCount: totalItemCount } = response;
|
||||
const run = async () => {
|
||||
const {
|
||||
Items: items,
|
||||
TotalRecordCount: totalItemCount
|
||||
}: JellyfinApiResponse = await fetchFromApi();
|
||||
|
||||
console.log("items:", items);
|
||||
console.log("totalItemCount:", totalItemCount);
|
||||
}
|
||||
|
||||
init();
|
||||
run();
|
||||
|
|
Loading…
Reference in a new issue