How to use fathom-client - 10 common examples

To help you get started, we’ve selected a few fathom-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pradel / sigle / src / modules / home / containers / Home.tsx View on Github external
const handleCreateNewPrivateStory = async () => {
    setLoadingCreate(true);
    try {
      const story = createNewEmptyStory();

      if (storiesFile) {
        storiesFile.stories.unshift(convertStoryToSubsetStory(story));

        await saveStoriesFile(storiesFile);
        await saveStoryFile(story);

        Fathom.trackGoal(Goals.CREATE_NEW_STORY, 0);
        router.push('/stories/[storyId]', `/stories/${story.id}`);
      }
    } catch (error) {
      console.error(error);
      toast.error(error.message);
      setLoadingCreate(false);
    }
  };
github pradel / twoblocks / src / context / FileContext.tsx View on Github external
const addAccount = async (account: Account) => {
    if (!state.file) return;
    Fathom.trackGoal(Goals.ADD_NEW_ACCOUNT, 0);
    const file = state.file;
    file.accounts.push(account);
    await putFile(file);
    dispatch({ type: 'success', file });
  };
github pradel / twoblocks / src / components / Login.tsx View on Github external
const handleLogin = () => {
    Fathom.trackGoal(Goals.LOGIN, 0);
    userSession.redirectToSignIn();
  };
github pradel / sigle / src / pages / login.tsx View on Github external
const handleLogin = () => {
    Fathom.trackGoal(Goals.LOGIN, 0);
    userSession.redirectToSignIn();
  };
github pradel / twoblocks / src / App.tsx View on Github external
useEffect(() => {
    if (config.fathomSiteId) {
      Fathom.load();
      Fathom.setSiteId(config.fathomSiteId);
      Fathom.trackPageview();
    }
  }, []);
github brianlovin / brian-lovin-next / src / components / Providers / Fathom.tsx View on Github external
React.useEffect(() => {
    if (process.env.NODE_ENV === 'production') {
      Fathom.load();
      Fathom.setSiteId('ONFMHEEY');
      Fathom.trackPageview();
    }
  }, [])
  return <span></span>
github brianlovin / brian-lovin-next / src / components / Providers / Fathom.tsx View on Github external
React.useEffect(() =&gt; {
    if (process.env.NODE_ENV === 'production') {
      Fathom.load();
      Fathom.setSiteId('ONFMHEEY');
      Fathom.trackPageview();
    }
  }, [])
  return <span></span>
github pradel / twoblocks / src / App.tsx View on Github external
useEffect(() => {
    if (config.fathomSiteId) {
      Fathom.load();
      Fathom.setSiteId(config.fathomSiteId);
      Fathom.trackPageview();
    }
  }, []);
github brianlovin / brian-lovin-next / src / components / Providers / Fathom.tsx View on Github external
Router.events.on('routeChangeComplete', () => {
  if (process.env.NODE_ENV === 'production') {
    Fathom.trackPageview()
  }
})
github pradel / twoblocks / src / App.tsx View on Github external
useEffect(() => {
    if (config.fathomSiteId) {
      Fathom.load();
      Fathom.setSiteId(config.fathomSiteId);
      Fathom.trackPageview();
    }
  }, []);

fathom-client

A simple wrapper around the Fathom Analytics library

MIT
Latest version published 5 months ago

Package Health Score

70 / 100
Full package analysis