This is not supposed to work as you expect. Edit mode is for working with geometry or data of selected object(s), object mode is for working with the objects in the scene. You can hide and show objects in object mode, and in edit mode you hide or show components of the objects like vertices, edges and faces. Modes are supposed to separate functionality like this for a single object or for multiple objects in the scene.