A refrigerator comprising: a storage chamber configured to be cooled by a cooling apparatus; a door coupled to the storage chamber and configured to open and close, and thereby open and close the storage chamber ; and a dispenser configured to discharge at least one of water and ice through an outlet in the door , the dispenser including: a driver configured to rotate around a first axis ; a cam configured to rotate around the first axis by a rotational force provided from the driver ; and an outlet cover configured to pivot around a second axis , different from the first axis , based on the rotation of the cam , wherein the first axis is substantially perpendicular to the second axis , wherein the cam includes a circumferential surface provided on a radial surface of the cam relative to the first axis , and a cam surface , provided on a surface perpendicular to the circumferential surface , wherein the circumferential surface includes a first protrusion and a second protrusion , and the first protrusion is spaced apart from the second protrusion , wherein the height of the cam surface changes according to rotation angles of the cam relative to the first axis , wherein the outlet cover comprises a lever including a protrusion configured to contact the cam surface of the cam , and as the cam rotates, the lever is configured to move in a vertical direction with respect to the cam surface , due to the difference in height of the cam surface , and thereby open and close the outlet based on a rotational position of the cam , wherein the dispenser further includes a first switch module and a second switch module , and wherein the first protrusion is configured to operate the first switch module and the second switch module based on the rotational position of the cam . a storage chamber configured to be cooled by a cooling apparatus; a door coupled to the storage chamber and configured to open and close, and thereby open and close the storage chamber ; and a dispenser configured to discharge at least one of water and ice through an outlet in the door , the dispenser including: a driver configured to rotate around a first axis ; a cam configured to rotate around the first axis by a rotational force provided from the driver ; and an outlet cover configured to pivot around a second axis , different from the first axis , based on the rotation of the cam , wherein the first axis is substantially perpendicular to the second axis , a driver configured to rotate around a first axis ; a cam configured to rotate around the first axis by a rotational force provided from the driver ; and an outlet cover configured to pivot around a second axis , different from the first axis , based on the rotation of the cam , wherein the first axis is substantially perpendicular to the second axis , wherein the cam includes a circumferential surface provided on a radial surface of the cam relative to the first axis , and a cam surface , provided on a surface perpendicular to the circumferential surface , wherein the circumferential surface includes a first protrusion and a second protrusion , and the first protrusion is spaced apart from the second protrusion , wherein the height of the cam surface changes according to rotation angles of the cam relative to the first axis , wherein the outlet cover comprises a lever including a protrusion configured to contact the cam surface of the cam , and as the cam rotates, the lever is configured to move in a vertical direction with respect to the cam surface , due to the difference in height of the cam surface , and thereby open and close the outlet based on a rotational position of the cam , wherein the dispenser further includes a first switch module and a second switch module , and wherein the first protrusion is configured to operate the first switch module and the second switch module based on the rotational position of the cam . <EOS>