dematerialize
Convierte un Observable de objetos Notification en las emisiones que representan
Description
Ejemplos
import { dematerialize } from "rxjs/operators";
import { of, Notification } from "rxjs";
const notification$ = of(
Notification.createNext("RxJS mola"),
Notification.createError(new Error("¡Oh no!"))
);
// Emitirá objetos Notification
notification$.subscribe(console.log);
/* Salida:
Notification { kind: 'N', value: 'RxJS is cool', error: undefined, ... },
Notification { kind: 'E', value: undefined, error: {...}, ...}
*/
// Al usar dematerialize, emitirá el valor de la notificación
notification$.pipe(dematerialize()).subscribe(console.log, console.error);
// Salida: RxJS is cool, (error) Oh noez!Ejemplo de la documentación oficial
Recursos adicionales
Last updated
