phantom icon indicating copy to clipboard operation
phantom copied to clipboard

Add example demonstrating a simple data-fetching application

Open sidiousvic opened this issue 4 years ago โ€ข 2 comments

We need to establish an in-component example to demonstrate how one could do data-fetching with phantom.

End result could be akin to this rough sketch (using GraphQL):

async function phantomComponent() {
  const usernameQuery = gql`{  data  {  username  } }`
  const username = await fetchUsername(query);
      return `${Profile(username)}`;
  }
}

How async functions behave with the phantom engine remains to be seen. ๐Ÿ˜ˆ

sidiousvic avatar Jul 02 '20 23:07 sidiousvic

Hello @sidiousvic ๐Ÿ‘‹ Is it ok if I work on this issue? I have an idea! Would it be ok to add a fourth example that has some async fetch calls?

mussinbenarbia avatar Jun 13 '21 07:06 mussinbenarbia

@mussinbenarbia Go ahead! Let me know if you run into a fundamental shortcoming of Phantom ๐Ÿ‘€

sidiousvic avatar Jun 17 '21 23:06 sidiousvic