slide-state

State controller for slide presentations

Usage no npm install needed!

<script type="module">
  import slideState from 'https://cdn.skypack.dev/slide-state';
</script>

README

slide-state

State controller for slide presentations

build status

browser support

Example

var slideState = require('slide-state')
var state = slideState()

state(function(current) {
  console.log(current)
})

console.log(state())
// {page: 1, sub: 0}

state.next()
// {page: 2, sub: 0}

state.nextSub()
// {page: 2, sub: 1}

state.prev()
// {page: 1, sub: 0}

License

MIT