0

Sorry to clarify, the following data structure:

const obs = Observable.fromPromise(firebase.storage().ref('Test').child('logo.png').getDownloadURL());

const json = {
  obs: obs,
  test: 1
};
const obs2 = Observable.of(
  json
);

So that would leave me with the following for obs2:

{…}:
   obs: Object { _isScalar: false, promise: {…}, scheduler: undefined }
   test: 1

I've been having trouble getting this obs2 stream flattened while also keeping the test variable as part of the structure. Ideally I should be working with a format that looks like:

{…}:
   url: 'url',
   test: 1

Thanks guys!

smeddles24
  • 101
  • 1
  • 1
  • 8

1 Answers1

0

If I understand your question right, it seems to me that this should do it:

obs2 = json.obs.map(url => { url, test: json.test })
ehrencrona
  • 6,102
  • 1
  • 18
  • 24