Skip to content

Unwrapping DataSnapshots #42

@davideast

Description

@davideast

Currently the providers automatically unwrap the DataSnapshots returned from the Firebase database.

Should we provide an option to keep the DataSnapshot intact?

class MyComponent {
  constructor(private af: AngularFire) {
    const obj = af.object('/name', { snapshot: true });
    obj.subscribe((snap) => {
      console.log(snap); 
    });
  }
}

Or perhaps we could use generics

class MyComponent {
  constructor(private af: AngularFire) {
    const obj = af.object<DataSnapshot>('/name');
    obj.subscribe((snap) => {
      console.log(snap); 
    });
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions