mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
some work on equipment
This commit is contained in:
1 parent
a40860901b
commit
e1cc60ea5e
4 files changed
+40
-1
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { api } from "../api/dynamic";
|
||||
import { useAwait } from "./useAwait";
|
||||
|
||||
export function useEquipment(presetId: string, priceId: string) {
|
||||
const [, presetName] = presetId.split(".");
|
||||
const [, priceName] = priceId.split(".");
|
||||
const preset = useAwait(
|
||||
() => api.equipmentPreset(presetId),
|
||||
`equipment-preset-${presetName}`,
|
||||
);
|
||||
const price = useAwait(
|
||||
() => api.equipmentPricePreset(priceId),
|
||||
`equipment-price-${priceName}`,
|
||||
);
|
||||
|
||||
return { preset, price };
|
||||
}
|
||||
Reference in new issue
Block a user