Difference between addValueEventListener() and addListenerForSingleValueEvent() of firebase

前端 未结 1 1762
走了就别回头了
走了就别回头了 2020-12-01 12:31

As the title says, I want to know the difference between addValueEventListener() and addListenerForSingleValueEvent() of Firebase.

相关标签:
1条回答
  • 2020-12-01 12:48

    addValueEventListener() keep listening to query or database reference it is attached to.

    But addListenerForSingleValueEvent() executes onDataChange method immediately and after executing that method once, it stops listening to the reference location it is attached to.

    0 讨论(0)
提交回复
热议问题