react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

[v3] ref.off not firing

Open alexkendall opened this issue 7 years ago • 2 comments

if(this.ref) {
  console.log("ref exists")
  this.ref.off('value', () => {
  console.log("off success")
    this.props.dispatch(logout())
   })
   .catch((error)=>{
     console.log(error)
   })
}

Output: ref exists

alexkendall avatar Feb 09 '17 17:02 alexkendall

For me, I got it to work when I only passed this.ref.off('value') – no callback. Your code suggests that you're removing the listener that you used for .on() I think

abcd-ca avatar Feb 13 '17 17:02 abcd-ca

@alexkendall @abcd-ca I've stopped working on v3 here and moved to my own repo.

.on on the web sdk docs returns the unmodified listener function that you can then pass to off when you want to unsub.

Salakar avatar Apr 07 '17 17:04 Salakar