Skip to content

Instantly share code, notes, and snippets.

View wlee221's full-sized avatar
🙃

William Lee wlee221

🙃
View GitHub Profile
@wlee221
wlee221 / vite.config.js
Created January 11, 2021 20:34
Vue 3: vite.config.js configuration for Amplify UI Componets
vueCompilerOptions: {
isCustomElement: tag => tag.startsWith('amplify-')
}
import Amplify from "aws-amplify";
import {
CognitoUserInterface,
onAuthUIStateChange,
AuthState,
} from "@aws-amplify/ui-components";
import { AmplifyAuthenticator, AmplifyTotpSetup } from "@aws-amplify/ui-react";
import { useEffect, useState } from "react";
Amplify.configure({ /** redacted */ });
@wlee221
wlee221 / machine.js
Last active June 30, 2021 09:28
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "signUp",
initial: "edit",
type: 'parallel',
states: {
validation: {
initial: 'pending',
states: {
pending: {
invoke: {
@wlee221
wlee221 / machine.js
Created June 24, 2021 19:22
Generated by XState Viz: https://xstate.js.org/viz
Machine(
{
id: 'signUp',
initial: "edit",
exit: ["clearFormValues", "clearError"],
states: {
edit: {
on: {
SUMBIT: "submit"
}
@wlee221
wlee221 / machine.js
Last active June 24, 2021 18:03
Generated by XState Viz: https://xstate.js.org/viz
Machine(
{
id: 'signUp',
initial: "edit",
exit: ["clearFormValues", "clearError"],
states: {
edit: {
id: "edit",
initial: "noError",
type: "parallel",
import { Component, State, Prop, h, Host, Element, forceUpdate } from '@stencil/core';
import {
AuthState,
CognitoUserInterface,
FederatedConfig,
UsernameAliasStrings,
AuthStateHandler,
} from '../../common/types/auth-types';
import {
AUTH_CHANNEL,
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wlee221
wlee221 / machine.js
Last active May 5, 2021 17:32
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wlee221
wlee221 / app-email.js
Last active April 27, 2021 09:03
Authenticator test templates for each usernameAlias
<AmplifyAuthContainer>
<AmplifyAuthenticator usernameAlias="email">
<AmplifySignIn
slot="sign-in"
headerText="My Custom Sign In"
usernameAlias="email"
formFields={[
{
type: 'email',
label: 'Custom Email Label',
@wlee221
wlee221 / machine.js
Last active April 19, 2021 21:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions