Intl.Segmenter
A polyfill for Intl.Segmenter
.
Installation
- npm
- yarn
npm i @formatjs/intl-segmenter
yarn add @formatjs/intl-segmenter
Features
Everything in intl-segmenter proposal
Usage
Simple
import '@formatjs/intl-segmenter/polyfill'
Dynamic import + capability detection
import {shouldPolyfill} from '@formatjs/intl-segmenter/should-polyfill'
async function polyfill(locale: string) {
if (shouldPolyfill()) {
await import('@formatjs/intl-segmenter/polyfill-force')
}
}