Let me tell you from experience what doesn't work: Putting a cell phone in a the pocket of a "waterproof" jacket. I lost a phone that way, and another one saw the light at the end of a foggy, damp tunnel before returning back to life.
If you are able to, turn gadgets you are carrying off. Having electricity flow through the system just increases the possibility of problems. For extra paranoia, remove the batteries.
My rule of thumb is that any important electric should be "double waterproofed". Usually this is accomplished with a plastic bag (not necessarily anything special), inside a supposedly-waterproof pannier. A small "dry bag" would be durable, waterproof choice for small electronics.
For touring, I looked for and found extra thick and tough garbage bags to use as an inner liner for my panniers. These are far less likely to be punctured than garden-variety plastic bags. Again, nothing special-- just a grocery store product.
In a pinch, use two plastic grocery bags, applied around the electrics in opposite directions.
If the gear does manage to get wet despite your best efforts, let it dry out thoroughly before turning it back on.