IkeaProductPanel.draw() calls get_pip() which will reload product JSON from disk every time, which feels suboptimal... Not sure how to do it better, and cleanly?
We could have a pair of global variables for current product ID and current product data, and reload the data from disk when the product ID changes, but that feels messy...
I ended up doing the globals thing, which is bad and I feel bad, but it works and is fairly self-contained if somebody wants to replace it with a better idea
IkeaProductPanel.draw()
callsget_pip()
which will reload product JSON from disk every time, which feels suboptimal... Not sure how to do it better, and cleanly?We could have a pair of global variables for current product ID and current product data, and reload the data from disk when the product ID changes, but that feels messy...