BACK
ReferencemapTo
Reference · 72

mapTo

mapTo

Deprecated
rxjs.dev

Replaces any value with a single constant.

Signature

mapTo(value: R): OperatorFunction

What it does

Ignores the input value and emits the same constant for every next.

When to use

Supporting legacy code. In new code use map(() => value) to avoid depending on a deprecated API.

Deprecated API

Marked deprecated in RxJS 7. In new code, use map(() => value).

See also

map

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...