
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
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
npm i usevault
const { gameState, addPlayer, ... } = useVault({ rounds: rounds })
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 |
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 |
FAQs
A React hook for creating a Vault score tracker.
We found that usevault demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.