import React from 'react'
import { messages } from '@cucumber/messages'

export class EnvelopesQuery {
  private envelopes: messages.IEnvelope[] = []

  public update(envelope: messages.IEnvelope) {
    this.envelopes.push(envelope)
  }

  public find(
    predicate: (envelope: messages.IEnvelope) => boolean
  ): messages.IEnvelope {
    return this.envelopes.find(predicate)
  }

  public filter(
    predicate: (envelope: messages.IEnvelope) => boolean
  ): messages.IEnvelope[] {
    return this.envelopes.filter(predicate)
  }
}

export default React.createContext(new EnvelopesQuery())

import React from 'react'
import { messages } from '@cucumber/messages'

export class EnvelopesQuery {
  private envelopes: messages.IEnvelope[] = []

  public update(envelope: messages.IEnvelope) {
    this.envelopes.push(envelope)
  }

  public find(
    callback: (envelope: messages.IEnvelope) => boolean
  ): messages.IEnvelope {
    return this.envelopes.find(callback)
  }

  public filter(
    callback: (envelope: messages.IEnvelope) => boolean
  ): messages.IEnvelope[] {
    return this.envelopes.filter(callback)
  }
}

export default React.createContext(new EnvelopesQuery())

--- 
+++ 
@@ -9,15 +9,15 @@
   }
 
   public find(
-    callback: (envelope: messages.IEnvelope) => boolean
+    predicate: (envelope: messages.IEnvelope) => boolean
   ): messages.IEnvelope {
-    return this.envelopes.find(callback)
+    return this.envelopes.find(predicate)
   }
 
   public filter(
-    callback: (envelope: messages.IEnvelope) => boolean
+    predicate: (envelope: messages.IEnvelope) => boolean
   ): messages.IEnvelope[] {
-    return this.envelopes.filter(callback)
+    return this.envelopes.filter(predicate)
   }
 }
 
Rename callback to predicate to better reveal intent
