Skip to content

Commit

Permalink
Update message subscription callback
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsc6955 committed Jan 24, 2024
1 parent ef739c9 commit 42e5d2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const penrose_paradox_1 = __importDefault(require("penrose-paradox"));
function MessageContainer(props = {}) {
const { callback = null } = props;
let count = 0;
const subscribe = penrose_paradox_1.default.pubsub.subscribe("button-clicked", callback ? callback : (message) => {
penrose_paradox_1.default.pubsub.subscribe("button-clicked", callback ? callback : ({ message }) => {
const messageContainer = document.getElementById("messageContainer");
if (!messageContainer)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { RouterProps } from "penrose-paradox/build/core/Router";
export default function MessageContainer(props: RouterProps = {}) {
const { callback = null } = props;
let count = 0;
const subscribe = Paradox.pubsub.subscribe("button-clicked", callback ? callback : (message) => {
Paradox.pubsub.subscribe("button-clicked", callback ? callback : ({ message }) => {
const messageContainer: HTMLElement | null = document.getElementById("messageContainer");
if (!messageContainer) return;
messageContainer.innerHTML = `${message} ${count}`;
Expand Down

0 comments on commit 42e5d2d

Please sign in to comment.