The code looks pretty straight-forward and I don't spot any obvious simplifications. I would suggest that you add error handling - especially for the case when uid
is not null
and remains that way. Perhaps an error message should be added if the request for the appropriate value fails.
Since ecmascript-6 is used (e.g. with the template literals) const
could be used instead of var
for any variable that doesn't get re-assigned (e.g. the components, db
, etc.) and let
for other variables (e.g. uid
).
You could also consider providing a key key attribute on the v-for
where the messages are displayed, but the markup is quite simple for those so it may not add any benefit.
It is recommended to provide a
key
withv-for
whenever possible, unless the iterated DOM content is simple, or you are intentionally relying on the default behavior for performance gains.1 1
1https://v2.vuejs.org/v2/guide/list.html#key
The code looks pretty straight-forward and I don't spot any obvious simplifications. I would suggest that you add error handling - especially for the case when uid
is not null
and remains that way. Perhaps an error message should be added if the request for the appropriate value fails.
Since ecmascript-6 is used (e.g. with the template literals) const
could be used instead of var
for any variable that doesn't get re-assigned (e.g. the components, db
, etc.) and let
for other variables (e.g. uid
).
You could also consider providing a key attribute on the v-for
where the messages are displayed, but the markup is quite simple for those so it may not add any benefit.
It is recommended to provide a
key
withv-for
whenever possible, unless the iterated DOM content is simple, or you are intentionally relying on the default behavior for performance gains.1
1https://vuejs.org/v2/guide/list.html#key
The code looks pretty straight-forward and I don't spot any obvious simplifications. I would suggest that you add error handling - especially for the case when uid
is not null
and remains that way. Perhaps an error message should be added if the request for the appropriate value fails.
Since ecmascript-6 is used (e.g. with the template literals) const
could be used instead of var
for any variable that doesn't get re-assigned (e.g. the components, db
, etc.) and let
for other variables (e.g. uid
).
You could also consider providing a key attribute on the v-for
where the messages are displayed, but the markup is quite simple for those so it may not add any benefit.
It is recommended to provide a
key
withv-for
whenever possible, unless the iterated DOM content is simple, or you are intentionally relying on the default behavior for performance gains.1
1https://v2.vuejs.org/v2/guide/list.html#key
The code looks pretty straight-forward and I don't spot any obvious simplifications. I would suggest that you add error handling - especially for the case when uid
is not null
and remains that way. Perhaps an error message should be added if the request for the appropriate value fails.
Since ecmascript-6 is used (e.g. with the template literals) const
could be used instead of var
for any variable that doesn't get re-assigned (e.g. the components, db
, etc.) and let
for other variables (e.g. uid
).
You could also consider providing a key attribute on the v-for
where the messages are displayed, but the markup is quite simple for those so it may not add any benefit.
It is recommended to provide a
key
withv-for
whenever possible, unless the iterated DOM content is simple, or you are intentionally relying on the default behavior for performance gains.1
1https://vuejs.org/v2/guide/list.html#key