mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: Migrate to Nuxt 3 framework (#5184)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
89ab7fac25
commit
c24d532608
403 changed files with 23959 additions and 19557 deletions
|
@ -1,19 +1,18 @@
|
|||
import { ref, reactive, Ref } from "@nuxtjs/composition-api";
|
||||
import { useReadOnlyActions, useStoreActions } from "./use-actions-factory";
|
||||
import { BoundT } from "./types";
|
||||
import { BaseCRUDAPI, BaseCRUDAPIReadOnly } from "~/lib/api/base/base-clients";
|
||||
import { QueryValue } from "~/lib/api/base/route";
|
||||
import type { BoundT } from "./types";
|
||||
import type { BaseCRUDAPI, BaseCRUDAPIReadOnly } from "~/lib/api/base/base-clients";
|
||||
import type { QueryValue } from "~/lib/api/base/route";
|
||||
|
||||
export const useData = function<T extends BoundT>(defaultObject: T) {
|
||||
export const useData = function <T extends BoundT>(defaultObject: T) {
|
||||
const data = reactive({ ...defaultObject });
|
||||
function reset() {
|
||||
Object.assign(data, defaultObject);
|
||||
};
|
||||
|
||||
return { data, reset };
|
||||
}
|
||||
};
|
||||
|
||||
export const useReadOnlyStore = function<T extends BoundT>(
|
||||
export const useReadOnlyStore = function <T extends BoundT>(
|
||||
store: Ref<T[]>,
|
||||
loading: Ref<boolean>,
|
||||
api: BaseCRUDAPIReadOnly<T>,
|
||||
|
@ -36,9 +35,9 @@ export const useReadOnlyStore = function<T extends BoundT>(
|
|||
}
|
||||
|
||||
return { store, actions };
|
||||
}
|
||||
};
|
||||
|
||||
export const useStore = function<T extends BoundT>(
|
||||
export const useStore = function <T extends BoundT>(
|
||||
store: Ref<T[]>,
|
||||
loading: Ref<boolean>,
|
||||
api: BaseCRUDAPI<unknown, T, unknown>,
|
||||
|
@ -61,4 +60,4 @@ export const useStore = function<T extends BoundT>(
|
|||
}
|
||||
|
||||
return { store, actions };
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue