The synchronized dynamics of time-varying networks