This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Ref, reactive, onMounted, watch, toRefs } from '@vue/composition-api' | |
// const { data, error } = useSWR('/api/user', fetcher) | |
export type fetcherFn<Data> = (...args: any) => Data | Promise<Data> | |
function isDocumentVisible (): boolean { | |
if ( | |
typeof document !== 'undefined' && | |
typeof document.visibilityState !== 'undefined' | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StateMachine, interpret, EventObject } from '@xstate/fsm' | |
import { ref, Ref, onBeforeMount } from '@vue/composition-api' | |
export default function useMachine<TContext, TEvent extends EventObject = EventObject> ( | |
stateMachine: StateMachine.Machine<TContext, TEvent, any>): { | |
current: Ref<StateMachine.State<TContext, TEvent, any>>, | |
send: StateMachine.Service<TContext, TEvent>['send'], | |
service: StateMachine.Service<TContext, TEvent>, | |
} { | |
const current = ref(stateMachine.initialState) as Ref<StateMachine.State<TContext, TEvent, any>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="stutterer"> | |
<svg | |
height="310" | |
width="310"> | |
<circle | |
ref="face" | |
class="clockFace" | |
cx="155" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<x-vue yell>Dude</x-vue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<Mouse :render="__render"/> | |
</div> | |
</template> | |
<script> | |
import Mouse from "./Mouse.js"; | |
export default { | |
name: "app", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Mouse = { | |
name: "Mouse", | |
props: { | |
render: { | |
type: Function, | |
required: true | |
} | |
}, | |
data() { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { shallow } from "vue-test-utils"; | |
import { createRenderer } from "vue-server-renderer"; | |
import VueToAKill from "../src/VueToAKill.vue"; | |
const defaultProps = { | |
agents: ['James Bond', 'Alec Trevelyan', 'M', 'Q'], | |
licenseToKill: true | |
}; |
NewerOlder