It would be an either/or configuration if done as cheaply as possible such as for a balcony storage system, not capable of both usages simultaneously.
You would then need to have a separate distribution of power from the battery system to your loads. Such as something like a 1000W true sine wave inverter to power essentials like laptop, phone chargers, basic lighting etc during a full power outage.