jeffminsungkim / Ashy

0 stars 0 forks source link

Display every user's current active status #7

Closed jeffminsungkim closed 6 years ago

jeffminsungkim commented 6 years ago

Objective Create a component to display every user's current active status, on the right side corner its list.

Requirements stack

jeffminsungkim commented 6 years ago

The structure of friends node has changed like below.

friends.json

{
  "5NnRVze6TVUeunLV0KXVmLby03J2": {
    "VkwT5IgS7ZYqDZ4uz5Dh76inrAK2": true,
    "dm8o0podI3gou0ob3wirkiyOGOu1": true
  },
  "VkwT5IgS7ZYqDZ4uz5Dh76inrAK2": {
    "5NnRVze6TVUeunLV0KXVmLby03J2": true
  },
  "dm8o0podI3gou0ob3wirkiyOGOu1": {
    "5NnRVze6TVUeunLV0KXVmLby03J2": true
  }
}

First, reference the friends node to retrieve a user's friend keys. Then, use the keys to pull a single or multiple object observables from firebase and then combine friends object observables to a new observable. As a result, an observable with an array that can be iterated over in the template.