Skip to content

Instantly share code, notes, and snippets.

@pavanjoshi914
Last active August 31, 2022 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavanjoshi914/cc5d3a6005a5ff88fa98cc60eb56ac70 to your computer and use it in GitHub Desktop.
Save pavanjoshi914/cc5d3a6005a5ff88fa98cc60eb56ac70 to your computer and use it in GitHub Desktop.
import PubSub from "pubsub-js";
import { updateAllowance } from "./allowances";
import {
paymentSuccessNotification,
paymentFailedNotification,
lnurlAuthSuccessNotification,
lnurlAuthFailedNotification,
} from "./notifications";
import { persistSuccessfullPayment } from "./persistPayments";
import { persistMetadata } from "./persistMetadata";
const subscribe = () => {
PubSub.subscribe("ln.sendPayment.success", paymentSuccessNotification);
PubSub.subscribe("ln.sendPayment.failed", paymentFailedNotification);
PubSub.subscribe("ln.sendPayment.success", persistSuccessfullPayment);
PubSub.subscribe("ln.sendPayment.success", updateAllowance);
PubSub.subscribe("ln.sendPayment.success", persistMetadata);
console.info(`Event subscriptions registered`);
};
export { subscribe };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment