-
Notifications
You must be signed in to change notification settings - Fork 22
MCDM Class Bundle first pass #1385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor svelte-y recommendations. Otherwise, lgtm.
I cannot test this at present, so I am basically relying on the limited TypeScript coverage to guide.
src/sheets/quadrone/actor/character-parts/favorites/FavoriteItemGeneric.svelte
Outdated
Show resolved
Hide resolved
src/sheets/quadrone/actor/character-parts/favorites/FavoriteItemGeneric.svelte
Outdated
Show resolved
Hide resolved
const sheetPreferences = SheetPreferencesService.getByType(context.actor.type); | ||
const sortMode = sheetPreferences.tabs?.[tabId]?.sort ?? 'm'; | ||
const sectionConfig = TidyFlags.sectionConfig.get(context.actor)?.[tabId]; | ||
const allSections: PowersSection[] = [...Object.entries(orderToPowersMap).map(([order, powers]) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason to spread here. .map
creates a new array and so does Object.entries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good call. I'm combining two arrays here, and originally did a .concat
, but typing disagreed because I hadn't specified the first map's type explicitly. Fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't realise you were concatenating. In which case, what you had before would have been fine. Both .concat
and spreading will create another array, the only way to avoid it would be by .push
ing the second array into the first but that just makes it more complicated.
I'll await any additional thoughts from Naito. |
Things added/changed:
FavoriteItemGeneric
had a minor glow-up (same "save" treatment as favorited spells)