npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mrdoge/react

v0.1.7

Published

React hooks for @mrdoge/client — live matches, odds, and one-shot lookups, backed by a shared cache so components watching the same data never duplicate a subscription.

Downloads

1,108

Readme

@mrdoge/react

React hooks for @mrdoge/client — live matches, live odds, and one-shot lookups, backed by a shared cache so components watching the same data never duplicate a subscription or a fetch.

npm install @mrdoge/react

No Provider required. The client and its cache are both module-level, same zero-setup shape as calling @mrdoge/client directly — you still need a token-mint route on your backend (see @mrdoge/client's README).

Usage

import { useLiveMatch } from "@mrdoge/react"

function Match({ matchId }: { matchId: string }) {
  const match = useLiveMatch({ matchId })

  if (match === undefined) return <p>Loading…</p>
  if (match === null) return <p>Couldn't load this match.</p>

  return <p>{match.homeTeam.name} vs {match.awayTeam.name}</p>
}

Mount useLiveMatch({ matchId: "123" }) in ten different components and they share one matches.subscribe() call and one copy of the data — the first mount starts it, the last unmount cancels it.

Hooks

| Hook | Wraps | Shape | |---|---|---| | useLiveMatch | matches.subscribe() | Shared subscription | | useMatch | matches.get() | Shared one-shot fetch | | useLiveOdds | odds.subscribe() | Shared subscription | | useTrendingMatches | matches.trending() | Shared one-shot fetch | | useMatches | matches.list() | Shared one-shot fetch | | useOddsMovement | — | Pure diff, no cache |

One-shot hooks cache their result for the lifetime of the page — a second mount with the same params reads the cache instead of refetching. There's no invalidation yet; call getMrDogeClient() directly for anything that needs a forced refresh.

Custom client config

import { configureMrDoge } from "@mrdoge/react"

// Call once, before any hook runs — e.g. at the top of your app's entry file.
configureMrDoge({ authEndpoint: "/api/mrdoge/token" })

Same options as MrDogeOptions in @mrdoge/client. Omit this entirely and it defaults to authEndpoint: "/api/mrdoge/token".