Skip to content

Commit

Permalink
improve events
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Oct 17, 2023
1 parent 4bc526e commit 8602c49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"imports": {
"$store/": "./",
"deco/": "https://denopkg.com/deco-cx/[email protected]/",
"apps/": "https://denopkg.com/deco-cx/apps@c710da3eef78369ad08529010cf83f3245ce63dc/",
"apps/": "../apps/",
"$fresh/": "https://denopkg.com/deco-cx/[email protected]/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
Expand Down
14 changes: 2 additions & 12 deletions sdk/analytics.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import type { AnalyticsEvent } from "apps/commerce/types.ts";

export const sendEvent = <E extends AnalyticsEvent>(event: E) => {
const doSend = window.DECO_SITES_STD &&
window.DECO_SITES_STD.sendAnalyticsEvent;

if (typeof doSend === "function") {
return doSend(event);
}

console.info(
"Cannot find Analytics section in your page. Press `.` to add Analytics and supress this warning",
);
};
export const sendEvent = <E extends AnalyticsEvent>(event: E) =>
window.DECO.events.dispatch(event);

1 comment on commit 8602c49

@deno-deploy
Copy link
Contributor

@deno-deploy deno-deploy bot commented on 8602c49 Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

Module not found "file:///apps/vtex/hooks/useWishlist.ts".

Please sign in to comment.