Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
¿Cómo devolver datos de un NodeJS EventEmitter en una devolución de llamada para el método TransferData.onSerialize() de Angular Universal?

Mi devolución de llamada TransferState.onSerialize() tiene que obtener datos de un EventEmitter .

Sin embargo, según tengo entendido, el primero es síncrono, mientras que el segundo es obviamente asíncrono.

Mi, en este fragmento minimizado, implementación en este momento, sin exactamente este punto, es:

 import { OnInit } from '@angular/core'; import { makeStateKey, StateKey, TransferState } from '@angular/platform-browser'; import SerializerJsonld from '@rdfjs/serializer-jsonld'; import type { Store } from '@rdfjs/types' import { EventEmitter } from 'stream'; export class DatastoreService implements OnInit { private readonly _store: Store; private readonly RESULT_KEY: StateKey<string> = makeStateKey < string > ('result'); async get_store(): Promise < Store > { await this._store.open(); return this._store; } constructor( private transferState: TransferState, ) {} ngOnInit(): void { this._store.open().then(store => { this.transferState.onSerialize(this.RESULT_KEY, () => { const output = new SerializerJsonld().import(this._store.match()); return ???; }); }); } }

¿Cómo puedo solucionar esto o en general tales situaciones?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!