Class ReactJSSourcesChangedEvent

java.lang.Object
java.util.EventObject
io.micronaut.context.event.ApplicationEvent
io.micronaut.views.react.ReactJSSourcesChangedEvent
All Implemented Interfaces:
Serializable

public final class ReactJSSourcesChangedEvent extends io.micronaut.context.event.ApplicationEvent
The ReactJS sources changed event.

Published when the server bundle or the render script has been reloaded, after the pool of GraalJS contexts has been dropped. Public so that a development module can tell the browser to refresh; micronaut-views-react-dev is the one that does.

Author:
Denis Stepanov
See Also:
  • Constructor Details

    • ReactJSSourcesChangedEvent

      public ReactJSSourcesChangedEvent(Object source, long generation)
      Records the source generation in the event so context providers can invalidate their context-bound module state without assuming that a source change permits closing a context.
      Parameters:
      source - The source manager that detected the change
      generation - The newly active source generation
  • Method Details

    • generation

      public long generation()
      Returns:
      The source generation active after the change