Skip to content

Instantly share code, notes, and snippets.

View peksipatongeis's full-sized avatar

Pekka Wallenius peksipatongeis

View GitHub Profile
@peksipatongeis
peksipatongeis / index.js
Created May 20, 2019 16:41
AuthContext
function AuthProvider(props) {
const [token, setToken] = useLocalStorage('token', '');
return <AuthContext.Provider value={{ token, setToken }} {...props} />;
}
function useLogin() {
const { setToken } = useContext(AuthContext);
const login = async ({ username, password }) => {
@peksipatongeis
peksipatongeis / markdown.md
Created May 19, 2016 12:37
markdown cheat sheet