Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 396 Bytes

File metadata and controls

14 lines (10 loc) · 396 Bytes

Tuples

The parseAsTuple parser allows you to parse fixed-length tuples with any type for each position.

import { parseAsInteger } from 'nuqs'
import { parseAsTuple } from '~/components/parsers/parseAsTuple'

// Coordinates tuple (x, y)
parseAsTuple([parseAsInteger, parseAsInteger])

// Optionally, customise the separator
parseAsTuple([parseAsInteger, parseAsInteger], ';')