-
Notifications
You must be signed in to change notification settings - Fork 8
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
use Maps to only iterate through slices that actually have a given action #2
Conversation
out of curiosity, is calling |
wow, nice! thanks for working on it. right, calling |
sure - do you want a separate PR for tests or should I just add them to this one? |
opened #3 with tests |
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.
Looks good to me!
Thanks for your work.
for (const [actionName, actionFn] of Object.entries(config.actions)) { | ||
let actionsBySlice = sliceMapsByAction.get(actionName); | ||
if (!actionsBySlice) { | ||
sliceMapsByAction.set(actionName, (actionsBySlice = new Map())); |
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 like this syntax. I think I used two statements before for this pattern.
i saw a FIXME and got an itch
there isn't really a test suite yet as far as i can tell, but i tried it out with the example and it still worked correctly