useLeaderboard
useLeaderboard(
handle,leaderboardReadOptions?):LeaderboardResult
A board as the page shows it: its top, the player’s friends or the rows
around the player, of its current period, the one before or one by id, kept
as it changes while the component is mounted. The top is a snapshot every
reader shares, rebuilt every 2 minutes while anyone looks: builtAt says how
old it is. A closed period’s top is its frozen result.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
handle |
LeaderboardHandle |
leaderboardReadOptions |
LeaderboardReadOptions |
Returns
Section titled “Returns”Example
Section titled “Example”const board = useLeaderboard(leaderboards.fastestLap.for(track));board.rows.map((row) => <li key={row.subject.id}>{row.rank} {row.name}</li>);