For mobile devices there are apps that will pretend to be something innocuous (say, a clock, or a flashlight app), and actually work as hidden storage. It would depend on whether the agents are using computerized inspection or manually looking through your phone (as they could easily build a blacklist of such apps), but if they're doing it manually and the app really does do the function it suggests it does and has a hidden unlock mechanism, they won't detect it.
For laptops, you can install multiple operating systems and simply set the BIOS or EFI bootloader to boot the dummy one by default when going to the airport and make sure the dummy hides the partitions of the real one. Once again, this will fool manual inspection, but not computerized. Fooling computerized inspection would require placing the real encrypted file system within the dummy one, without any headers indicating that it's a file system: much more complicated and can lead to data loss if the dummy system writes over it.
Either way, you don't want to simply wipe everything and restore once you're across borders if you actually want to cross. For one, there's the chance they'll just confiscate your device, but if you're not a citizen of the country you're entering, they'll just deny you entry on suspicion. You want something that's fake, but convincing, which takes effort.