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

@rific/splash-gate

v0.1.2

Published

Name every async condition an Expo app's first screen depends on (theme, fonts, saved preferences, auth, ...) and hold the splash screen up until all of them report ready — instead of hand-rolling a fresh ad hoc gate per project

Readme

@rific/splash-gate

Name every async condition your Expo app's first screen actually depends on (a loaded theme, a loaded icon font, a hydrated saved preference, an auth check) and hold the splash screen up until all of them report ready. One shared, tested utility instead of a fresh ad hoc module-scope gate copy-pasted into every project.

Why

SplashScreen.preventAutoHideAsync() only holds the splash up. It's on you to call hideAsync() at the right moment. Call it too early (e.g. the instant your theme loads) and anything else your first screen depends on but forgot to wait for, an icon font, a hydrated preference, pops in visibly a moment after the splash lifts. createSplashGate makes every condition explicit up front, so nothing can be forgotten silently.

Installation

npm install @rific/splash-gate

Usage

// splashGate.ts, created once, at module scope, listing every condition this app's first
// screen actually depends on
import { createSplashGate } from '@rific/splash-gate'

export const { markReady, useReady, pendingGates } = createSplashGate(['theme', 'fonts', 'keyboardLayout'])
// Theme.tsx
import * as SplashScreen from 'expo-splash-screen'
import { useFonts } from 'expo-font'
import { markReady, useReady } from './splashGate'

SplashScreen.preventAutoHideAsync()

export const Theme = ({ children }) => {
  const [fontsLoaded] = useFonts({ ... })
  useReady('fonts', fontsLoaded)

  const onThemeReady = () => markReady('theme') // a one-shot callback, not a boolean, call directly

  return <Provider onReady={onThemeReady}>{children}</Provider>
}
// KeyboardLayoutProvider.tsx
import { useReady } from './splashGate'

const [loaded, setLoaded] = useState(false)
useEffect(() => {
  void AsyncStorage.getItem(STORAGE_KEY).then((stored) => {
    if (stored) setLayoutState(stored)
    setLoaded(true) // mark loaded whether or not a saved value was actually found
  })
}, [])
useReady('keyboardLayout', loaded)

The splash screen hides exactly once, the moment theme, fonts, and keyboardLayout have all reported ready, in whatever order they actually resolve.

API

createSplashGate(gates)

Takes an array of gate names (typically as const for literal-type safety) and returns:

  • markReady(gate): marks one gate ready. Safe to call more than once for the same gate, and safe in any order. Hides the splash screen exactly once, once every gate is ready. For a gate that only resolves via a one-shot callback (a library's own onReady prop, a promise .then), call this directly there.
  • useReady(gate, ready): for a gate whose readiness is already a plain boolean (state from a hook like useFonts, or your own derived condition), marks it ready once ready becomes true. Bound to this gate instance, so there's nothing to pass but the two things that actually vary at each call site.
  • pendingGates(): the gate names still outstanding, for a debug log during development.

Call this once, at module scope, not inside a component body, or you'll get a fresh gate (and a fresh splash-hide race) on every render.