🏝️ Koh.js - Interval Island!

This example demonstrates the use of:


import { island } from './static/koh-js/core/index.js'
import { fromInterval } from './static/koh-js/stream/index.js'
import { startWith } from './static/koh-js/operators/index.js'

island('interval-island', k => {
    const timer$ = fromInterval(1000)

    // // Automatically update the span text whenever the interval stream changes
    k.sync('span', timer$)

    // Listen for clicks and pause or resume the stream
    k.on('[name="stop"]', 'click', () => {
        timer$.pause()
    })
    k.on('[name="start"]', 'click', () => {
        timer$.resume()
    })
})                  
                
                

<interval-island />

Timer: 0