vue-robot

0.0.8 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i vue-robot

Weekly Downloads

1

Version

0.0.8

License

none

Unpacked Size

2.02 kB

Total Files

6

Last publish

Collaborators

  • derz