Preventing same Event handler assignment multiple times

前端 未结 4 1254
一向
一向 2020-12-13 23:37

If I am assigning an event handler at runtime and it is in a spot that can be called multiple times, what is the recommended practice to prevent multiple assignments of the

4条回答
  •  醉酒成梦
    2020-12-14 00:23

    I tend to add an event handler in a path that's executed once, for example in a constructor.

提交回复
热议问题