// import type { char } from '../types/basic'; import { map } from 'rxjs'; import { inputPipe } from '../utils/input-pipe'; /** * An Event Operator emitting event.key instead of any KeyboardEvent object * @returns OperatorFunction * * For one-step input pipelines, see the {@link Key | Key (uppercase)} Event Adapter * * ## Examples * * ### Collect distinct vowels typed in a text box * * The following illustrates how to get any key presses from the text box * and only pass the actual character through to the main stream * * ```ts * import { Subject, distinct, filter, scan } from 'rxjs'; * import { rml, source, key } from 'rimmel'; * * const isVowel = filter(c => 'aeiou'.includes(c)); * * const Component = () => { * const vowels = new Subject().pipe( * distinct(), * scan((a, b) => a.concat(b)), * ); * * return rml` * Unique vowels pressed: "${vowels}"" * * ${stream}"" * * ${stream}"" * *