Dynamical switching of tungsten ditelluride via ion insertion