Skip to content

Commit

Permalink
Fix TypeScript error
Browse files Browse the repository at this point in the history
  • Loading branch information
luisherranz committed Feb 19, 2022
1 parent 0fce06c commit d347626
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/frontity/src/commands/subscribe.ts
@@ -1,15 +1,21 @@
import { EventPromised } from "../utils/eventPromised";
import { subscribe } from "../steps";

// TODO: make param an object
/**
* Subscribe to Frontity newsletter.
*
* @param email - The email to be subscribed.
* @param emit - The eventEmitter to send messages.
* @param reject - The promise reject method in case something goes wrong.
*/
const subscribeCommand = async (
email: string,
emit: (event: string, ...value: any[]) => void,
reject: (reason: any) => void
) => {
try {
emit("message", "Subscribing to frontity");
await subscribe(email);
await subscribe();
} catch (error) {
reject(error);
}
Expand Down

0 comments on commit d347626

Please sign in to comment.