My icon should have "on" state when there is user_favourite_model present, and "off" state when there is no model (if i delete it).
I used first commented approach, but once i clicked really fast on the icon, the icon (observer) lagged behind and even after i deleted model in DB it still displayed count as 1. So in database there was no item, but isItemInFavourite injected 1 as prop inside my FavItemIcon.
BUT! When i used simple "observer" like uncommented code, and then inside FavItemIcon checked length of Query everything is on point real time, no matter how fast i click icon (obviously, it is lazy, so not exactly real time, but everything will catch up within few hundred milliseconds max.).
Am i doing something wrong, or there is some limitation to observeCount() function so it can't work as fast?
Hello,
quick question, i can't figure out if this is some WM limitation, or if i did something wrong.
I have simple icon enhanced by some data, nothing fancy:
My icon should have "on" state when there is user_favourite_model present, and "off" state when there is no model (if i delete it). I used first commented approach, but once i clicked really fast on the icon, the icon (observer) lagged behind and even after i deleted model in DB it still displayed count as 1. So in database there was no item, but isItemInFavourite injected 1 as prop inside my FavItemIcon. BUT! When i used simple "observer" like uncommented code, and then inside FavItemIcon checked length of Query everything is on point real time, no matter how fast i click icon (obviously, it is lazy, so not exactly real time, but everything will catch up within few hundred milliseconds max.).
Am i doing something wrong, or there is some limitation to observeCount() function so it can't work as fast?