A unified theory of weak continuity for functions