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 🙏

© 2024 – Pkg Stats / Ryan Hefner

usevault

v0.3.3

Published

A React hook for creating a Vault score tracker.

Downloads

11

Readme

useVault Hook

npm version

A React hook for creating a Vault score tracker. Written in Typescript.

Created by Jameson Brown @ Atomic10 Studio
Designed by Christopher Brown @ Barely Fiction Experiences

Installation

NPM

npm i usevault

Usage

const { gameState, addPlayer, ... } = useVault({ rounds: rounds })

Properties

| Prop | Type | Description | Default | | ---------------------- | ------ | --------------------------------------------------- | ------- | | rounds | number | The number of rounds per game. | 10 | | roundTransitionDelay | number | The number of ms for the transition between rounds. | 2000 |

Return Values

| Value | Type | Description | | ------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------- | | gameState | GameState | The state of the game to provide key details. | | gameState.round_over | boolean | If the current round has ended(7 out or all vaulted). roundTransitionDelay is the delay till this value auto resets. | | gameState.game_over | boolean | If the game has ended(all rounds completed). | | gameState.current_round | number | The number of the current round. | | gameState.total_rounds | number | The total number of rounds for the game. Set with props.rounds defaulting to 10. | | gameState.players | Players[] | List of players that doesn't change. | | gameState.roll_queue | Players[] | List of players that reflects updates to turns, score, if vaulted, etc. | | gameState.roll_history | Roll[] | List of roll history. Length can be used for roll count, sum of roll.value can be used for round total. | | addPlayer | function | Function to add new player to gameState.players and gameState.roll_queue. | | removePlayer | function | Function to remove player from gameState.players and gameState.roll_queue. | | rollDice | function | Function to record a new dice roll. | | undoRoll | function | Function to undo last dice roll. Can only undo dice roll from current round. | | vault | function | Function to vault a player with the current round score. | | replay | function | Function to replay/restart a new round. Can update players and round count after calling this function but before rollDice |