No need to define an anonymous function here,  pass `showPairView` function variable directly.