import { map } from 'rxjs'; import { inputPipe } from '../utils/input-pipe'; import { Source } from "../types/source"; /** * An Event Operator emitting a numerical dataset value from the underlying element instead of a regular DOM Event object * @returns OperatorFunction * @example **/ export const numberset = (key: string) => map((e: Event) => Number((e.target).dataset[key])); /** * An Event Source emitting a numerical dataset value from the underlying element instead of a regular DOM Event object * @returns EventSource * @example * @example **/ export const Numberset = (key: string): Source => inputPipe( numberset(key) ) ; export const asNumberset = numberset; export const AsNumberset = Numberset;