Skip to content

Improve init and add related functions#205

Merged
stordahl merged 2 commits intomainfrom
stordahl/improve-init
Jul 30, 2025
Merged

Improve init and add related functions#205
stordahl merged 2 commits intomainfrom
stordahl/improve-init

Conversation

@stordahl
Copy link
Copy Markdown
Collaborator

@stordahl stordahl commented Jul 26, 2025

Fixes #188

  • Return silently from Counterscale.init() instead of throwing when a client is already initialized
  • Adds Counterscale.isInitialized() - a convenience method if you need to know if a client exists but don't need the client itself
  • Adds Counterscale.getInitializedClient() - returns a client if one exists, otherwise returns undefined
  • Also adds docs for all Counterscale.* methods in the root README

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.93%. Comparing base (7bcb1b7) to head (8b33820).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #205      +/-   ##
==========================================
+ Coverage   79.77%   79.93%   +0.15%     
==========================================
  Files          43       43              
  Lines        3353     3359       +6     
  Branches      417      421       +4     
==========================================
+ Hits         2675     2685      +10     
+ Misses        670      666       -4     
  Partials        8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stordahl stordahl marked this pull request as ready for review July 26, 2025 03:51
@wesbos
Copy link
Copy Markdown

wesbos commented Jul 29, 2025

this looks great - exactly what I wanted. Hopefully @benvinegar will merge next time he does work on counterscale

@stordahl
Copy link
Copy Markdown
Collaborator Author

@wesbos Great! I've joined Ben as a maintainer of counterscale, so I'll make sure this gets into the next release. Thanks again for reporting this!

@wesbos
Copy link
Copy Markdown

wesbos commented Jul 29, 2025

oh dang, amazing! Thanks a ton!

@stordahl stordahl merged commit e3cbf97 into main Jul 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide way to access client initialization state

2 participants