Is there a better way??

When I have my baby my plan is to buy a rocker or something like that (not a swing) so when I have to use the bathroom I can just set it in there up with my baby so my baby is with me and not alone is this a bad idea? Is there a better way to do it??