Skip to content

Instantly share code, notes, and snippets.

export function fromObject<T extends jspb.Message, U>(c: new () => T, obj: U): T {
const instance = new c();
Object.keys(obj)
.forEach(key => {
const setterName = makeSetterFuncName(key);
(instance as any)[setterName] = (obj as any)[key];
});
return instance;
}
import * as React from 'react';
import * as GoogleWebAuth from 'expo-auth-session/providers/google';
import * as GoogleAppAuth from "expo-google-app-auth";
import * as WebBrowser from 'expo-web-browser';
import * as AppAuth from 'expo-app-auth';
import { Platform } from 'react-native';
import Constants, {AppOwnership} from 'expo-constants';
// Call this function once in your Component which handles the Google authentication
// flow; typically done outside of the component decleration (ie: just after your