Skip to content

Once Events

Daniel Busłowicz edited this page Oct 7, 2016 · 1 revision

Some events just shouldn't fire more than once. Typed Polymer knows that very well, so it provides you with the @once decorator. It works pretty much the same as the @on decorator, but once it fires, it will unregister itself. The other difference is, that @once does NOT allow a selector (it uses Polymer events system).

class MyComponent extends TypedPolymer {
  @once("user-paid")
  removeAds(): void {
    /* ... */.
  }
}
MyComponent.register();

Links

Similar projects (that I know of)

Clone this wiki locally