Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Created May 19, 2020 16:07
Show Gist options
  • Save ozcanzaferayan/de832270381ad403ad0177f8e924f75d to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/de832270381ad403ad0177f8e924f75d to your computer and use it in GitHub Desktop.
export const currentUserNameQuery = selector({
key: "CurrentUserName",
get: async ({ get }) => {
const response = await fetch(`https://api.github.com/users/ozcanzaferayan`);
if (response.error) {
throw response.error;
}
const json = await response.json();
return json.name;
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment