EVT
HomeGitHub
v1
v1
  • Why EVT ?
  • Overview
  • API Documentation
    • Evt<T>
      • evt.attach*(...)
      • evt.post*(data)
      • evt.waitFor(...)
      • evt.evt[Attach|Detach]
      • evt.pipe(...)
      • evt.getHandlers()
      • evt.isHandled(data)
      • evt.detach(ctx?)
      • evt.enableTrace(...)
      • evt.setMaxHandlers(n)
      • toStateful(initialState)
      • evt.getStatelessOp(op)
      • Evt.create(initalState?)
      • Evt.newCtx<T>()
      • Evt.getCtx(object)
      • Evt.from<T>(...)
      • Evt.merge([ evt1, evt2, ... ])
      • Evt.loosenType(evt)
      • Evt.factorize(evt)
      • Evt.asPostable(evt)
      • Evt.asNonPostable(evt)
      • Evt.setDefaultMaxHandlers(n)
    • Ctx<T>
    • Operator<T, U> (type)
    • StatefulEvt<T>
    • Helper types
    • Handler<T, U> (type)
  • React hooks
  • Extending Evt
Powered by GitBook
On this page
  1. API Documentation
  2. Evt<T>

evt.setMaxHandlers(n)

Previousevt.enableTrace(...)NexttoStateful(initialState)

Last updated 2 years ago

By default Evt will print a warning if more than 25 handlers are added. This is a useful default that helps finding memory leaks. Not all events should be limited to 25 handlers. The evt.setMaxHandlers() method allows the limit to be modified for this specific Evt instance. ( Use the static method to change this limit globally.

The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

Returns a reference to the Evt, so that calls can be chained.

Evt.setDefaultMaxHandlers()