0.0.8 • Published 3 years ago

vue-robot v0.0.8

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

Vue Robot

Vue wrapper for Robot

Example

<template lang="pug">
button(
	type="button"
	:click="send('toggle')"
)
	| {{ state.name }}
</template>

<script setup>
import { useMachine } from 'vue-robot';
import { createMachine } from 'robot3';

const toggleMachine = createMachine({
	on: state(
		transition('toggle', 'off')
	),
	off: state(
		transition('toggle', 'on')
	)
});

const { currentState, send } = useMachine(toggleMachine);
</script>

API

useMachine(machine, initialContext?)

...

Arguments

  • machine
  • initialContext

Returns { currentState, send, service}:

  • currentState
  • send
  • service
0.0.8

3 years ago

0.0.3

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago