naver / egjs

Javascript components group that brings easiest and fastest way to build a web application in your way.
https://naver.github.io/egjs
Other
937 stars 81 forks source link

once method of Component #412

Closed mixed closed 7 years ago

mixed commented 7 years ago

Description

Sometime, Users want to bind one time. If there is no once, attch event and should be detach event. It is too complicated.

Steps to check or reproduce

var fp = function(){
 // do something
  a.off(fp);
}

a.on(fp);

->

var fp = function(){
 // do something
}

a.once(fp);