Skip to content
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

feat: added events option with onClick #137

Merged
merged 3 commits into from
Jun 18, 2023
Merged

Conversation

JoshuaKGoldberg
Copy link
Owner

PR Checklist

Overview

Replaces the tagName option with an events object. So far, per #136, it just has an onClick optional property.

This notably means that users are now provided the actor: EmojiActor for the first (intentional) time ever. Actors now have an update() function that can take in a new opacity and/or velocity. Applies a couple of refactors in support of that:

  • Switches the Animator class to just an animate function, since there was no reason to expose the start or tick methods to consumers before
  • Switches actor state to # privates with getters on top of them, so that the types can mark them as Readonly<...>

One nifty thing is the domNodesToActors: WeakMap<EventTarget, EmojiActor>. It maps from click event targets back to the emoji actor in the library.

@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Merging #137 (11afce7) into main (8e64673) will decrease coverage by 0.33%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main    #137      +/-   ##
========================================
- Coverage   2.94%   2.61%   -0.33%     
========================================
  Files         13      14       +1     
  Lines        849     955     +106     
========================================
  Hits          25      25              
- Misses       824     930     +106     
Impacted Files Coverage Δ
src/actor.ts 0.00% <0.00%> (ø)
src/animate.ts 0.00% <0.00%> (ø)
src/emojisplosion.ts 0.00% <0.00%> (ø)
src/events.ts 0.00% <0.00%> (ø)
src/styles.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/events.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg merged commit 714fb8e into main Jun 18, 2023
11 of 13 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the events-on-click branch June 18, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 Feature: Allow an onClick option for clicking emojis
2 participants