refactor: split bloated state types into State + Actions interfaces (issue #102)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s
- CombatState: split into CombatState (data) + CombatActions + CombatStore - PrestigeState: split into PrestigeState (data) + PrestigeActions + PrestigeStore - ManaState: split into ManaState (data) + ManaActions + ManaStore - GameState: deprecated, removed from barrel exports - crafting-actions: updated to use CraftingState instead of GameState - combat-utils/mana-utils: replaced Pick<GameState,...> with focused interfaces - DisciplineCardProps: split into Definition + Runtime + Callbacks - stores/index.ts: now exports both State and Actions types
This commit is contained in:
@@ -183,24 +183,26 @@ export const useCraftingStore = create<CraftingStore>()(
|
||||
|
||||
// Enchantment application actions
|
||||
startApplying: (equipmentInstanceId, designId) => {
|
||||
const currentAction = useCombatStore.getState().currentAction;
|
||||
return ApplicationActions.startApplying(
|
||||
equipmentInstanceId,
|
||||
designId,
|
||||
get,
|
||||
set
|
||||
set as unknown as (partial: Partial<CraftingState>) => void,
|
||||
currentAction
|
||||
);
|
||||
},
|
||||
|
||||
pauseApplication: () => {
|
||||
ApplicationActions.pauseApplication(get, set);
|
||||
ApplicationActions.pauseApplication(get, set as unknown as (partial: Partial<CraftingState>) => void);
|
||||
},
|
||||
|
||||
resumeApplication: () => {
|
||||
ApplicationActions.resumeApplication(get, set);
|
||||
ApplicationActions.resumeApplication(get, set as unknown as (partial: Partial<CraftingState>) => void);
|
||||
},
|
||||
|
||||
cancelApplication: () => {
|
||||
ApplicationActions.cancelApplication(set);
|
||||
ApplicationActions.cancelApplication(set as unknown as (partial: Partial<CraftingState>) => void);
|
||||
useCombatStore.setState({ currentAction: 'meditate' });
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user