BACK
Referencepluck
Reference · 84

pluck

pluck

Deprecated
rxjs.dev

Pulls a nested field out of an object.

Signature

pluck(...properties: string[]): OperatorFunction

What it does

Takes a property path and emits the value at that path. If the path is missing, the result is undefined.

When to use

Supporting legacy code. In new code, map(x => x.field) types better and reads more clearly.

Deprecated API

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

See also

map

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