One example is a CD boombox. Battery-powered.
During operation, if I pull or insert a cable, it restarts, if the cable is connected to the wall power supply.
If I pull/insert fast enough, it even stays on, but the screen backlight of the JVC RC-EX30 goes dark for the fraction of a second.
If I insert a cable which is not connected to the wall on the other side, the device refuses to run from batteries, unlike smartphones, that also run while the USB cable is connected but not powered by any power source or by an empty powerbank.