You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By adding generic to PubSubEngine, a lot of typos and (hard) type lookup can be prevented.
has-reproduction
feature
blocking
good first issue
Here is an example of the type definition to look like in the end.
const pubSub = new PubSub<{
commentsChanged: Comment[],
postsChanged: Post[],
}>();
// `pubSub.publish` will now only accept keys listed in generic type of `pubSub` instance
// **The type must match too!**
pubSub.publish('commentAdded', { commentAdded: new Comment( /*...*/ )] });
Here is what needed to be done. (I looked that there is an ongoing change to rename asyncIterator and didn't felt like dealing with it.)
By adding generic to PubSubEngine, a lot of typos and (hard) type lookup can be prevented.
Here is an example of the type definition to look like in the end.
Here is what needed to be done. (I looked that there is an ongoing change to rename
asyncIterator
and didn't felt like dealing with it.)pubsub-engine.d.ts
pubsub.d.ts
The text was updated successfully, but these errors were encountered: