If you can keep up software support, the hardware becomes much more valuable both now and later, but this is much harder to do in the consumer space where the software than in the industrial/AI space; I'd say the majority of my PC replacements until I was established financially were the result of software not supporting my hardware (not that it couldn't do the task if there were support, but simply that there was no support), and I should say, too, that in almost every case, I regretted dumping $1k in today-dollars for a single game or application otherwise.
Obviously, the problem's much worse with phones/tablets where most people use them for Cloud activities; people use them for 2-3 years and they go in the trash or their service provider might buy it back essentially as e-waste to be scrapped (despite marketing implications of them being reused to help surgeons in Africa).