Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
async unsubscribe() {
const topics = await this.getTopics();
if (!topics) {
throw Error(`Topics got undefined`);
}
return this.removeTopics({
[process.env.TOPICS_TABLE]: topics.map(({ topic, connectionId }) => ({
DeleteRequest: { Key: { topic, connectionId } },
})),
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment