Skip to content

Commit

Permalink
fix: adds updateCreatureByName tracker method
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 authored May 13, 2023
1 parent 1ee838a commit 94396a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tracker/stores/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ function createTracker() {
updating,
updateTarget,
updateCreatures,
updateCreatureByName: (name: string, change: CreatureUpdate) =>
update((creatures) => {
const creature = creatures.find(c => c.name == name);
if (creature) {
return updateCreatures({ creature, change });
}
return creatures;
}),

players: derived(ordered, (creatures) =>
creatures.filter((c) => c.player)
Expand Down

0 comments on commit 94396a2

Please sign in to comment.