useCollator @astryx-svelte/core v0.4.5 · i18n

Usage

Returns the sanctioned locale-aware comparator for custom sorting. The collator is recreated when the provider locale or an option changes.
ts
import { i18n } from '@astryx-svelte/core';

Best practices

GuidancePractices
DoReuse collator.compare in custom Table comparators and other user-visible string ordering.
Don'tConstruct Intl.Collator directly or call localeCompare; those bypass the provider-backed locale contract.

Parameters

ParameterTypeDefaultDescription
options () => Intl.CollatorOptionsOptional collation behavior such as numeric ordering, sensitivity, punctuation handling, and case order.

Returns

FieldTypeDefaultDescription
collator Intl.CollatorA memoized collator bound to the active InternationalizationProvider locale.

Not declared by core, so this type is mapped from upstream's rather than read from the compiler.