Snowplow event tracker for client-side and server-side JavaScript. Add analytics to your websites, web apps and servers.
BSD 3-Clause "New" or "Revised" License
541
stars
218
forks
source link
Update ContextGenerator function return type to also accept SelfDescribingJson list and undefined #1070
Closed
af-tomwilkins closed 2 years ago
Describe the bug ContextGenerator functions can be passed to
addGlobalContext
. The type definition ofContextGenerator
is as follows:This constraint doesn't appear to reflect what's possible with Context Generators:
My suggestion is to update the type definition to be this:
To Reproduce
Using the example from then documentation should redline in an IDE using TypeScript.
Expected behavior
addGlobalContexts
should accept ContextGenerator functions that return SelfDescribingJson, a SelfDescribingJson list, orundefined
.