Error Subscribing To Events In Default Docs

Using the Flow Docs description for how to subscribe to events is simply:

// in some react component => {

However all attempts at using this give the error:

Error: invalid query: start block must be <= end block

Along with a bunch of warnings for the use of the deprecated latestBlock() instead of block().

Am I to assume the events attribute is no longer being supported? How should I poll for my contract events? Continuously calling getEventsAtBlockHeightRange() seems an inconvenient solution. Appreciate any insight!

Hi there @isaw81 !

Here’s a video reference if you’d like to learn more about polling events:

Also a bunch of cool ecosystem tools you can use such as Graffle or Alchemy’s API for Flow

Would recommend Graffle as it’s infinitely easier than running your own event indexer - so that you can focus on building your actual application.

Let me know if this was useful or if you need more support!