A refrigerator comprising: a storage chamber (20, 30) configured to be cooled by a cooling apparatus; a door (21, 22) coupled to the storage chamber (20, 30) and configured to open and close, and thereby open and close the storage chamber (20, 30); and a dispenser configured to discharge at least one of water and ice through an outlet in the door (21, 22), 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 (3091, 3093, 3095, 3097), 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 (3091, 3093, 3095, 3097) 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 (3091, 3093, 3095, 3097) of the cam, and as the cam rotates, the lever is configured to move in a vertical direction with respect to the cam surface (3091, 3093, 3095, 3097), due to the difference in height of the cam surface (3091, 3093, 3095, 3097), 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 (20, 30) configured to be cooled by a cooling apparatus; a door (21, 22) coupled to the storage chamber (20, 30) and configured to open and close, and thereby open and close the storage chamber (20, 30); and a dispenser configured to discharge at least one of water and ice through an outlet in the door (21, 22), 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 (3091, 3093, 3095, 3097), 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 (3091, 3093, 3095, 3097) 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 (3091, 3093, 3095, 3097) of the cam, and as the cam rotates, the lever is configured to move in a vertical direction with respect to the cam surface (3091, 3093, 3095, 3097), due to the difference in height of the cam surface (3091, 3093, 3095, 3097), 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.