bytespin

spinner nanocomponent that cycles through a given list of characters

Usage no npm install needed!

<script type="module">
  import bytespin from 'https://cdn.skypack.dev/bytespin';
</script>

README

bytespin

npm version npm

spinner nanocomponent that cycles through a given list of characters ( demo )

installation

npm install --save bytespin

usage

spinner = Spinner(opts) creates a new Spinner instance.

{
  chars: string  // characters to cycle through
  speed: number // spinning speed in ms
}

example

var Spinner = require('bytespin')
var spinner = Spinner({ chars: '\\|/-', speed: 125 })

function view (state, emit) {
  return `
    <div>
      ${spinner.render(state.fetching)}
    </div>`
}