What jimbob86 said
Both. I decide I want something, and save up the cash..... then, when I have the cash, I see something on sale, which may or may not be the thing I wanted in the first place, and I buy it.
I narrow down what I want, I save up, then buy whatever shiny thing seems like a good idea at the time.
I have learned to be less narrowed and keep a running list of what I want.