We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oneメソッドが正常に動作しないようです。
tm.main(function() { var count = 0; var test = tm.event.EventDispatcher(); test.one("testevent", function() { count += 1; console.log("testevent 1") }); test.one("testevent", function() { count += 1; console.log("testevent 2") }); test.one("testevent", function() { count += 1; console.log("testevent 3") }); test.one("testevent", function() { count += 1; console.log("testevent 4") }); test.one("testevent", function() { count += 1; console.log("testevent 5") }); test.fire(new tm.event.Event("testevent")); console.assert(count === 5); test.firenew tm.event.Event("testevent")); console.assert(count === 5); });
上記コードを実行すると、以下の様な出力となります。
testevent 1 index.html:13 testevent 3 index.html:15 testevent 5 index.html:17 Uncaught TypeError: Cannot call method 'call' of undefined tmlib.js:1930
イベントハンドラ内でイベントリスナーを削除しているのが原因と思われます。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
oneメソッドが正常に動作しないようです。
上記コードを実行すると、以下の様な出力となります。
イベントハンドラ内でイベントリスナーを削除しているのが原因と思われます。
The text was updated successfully, but these errors were encountered: