# cyclejs-fundamentals

Plunker example for cycleJS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div id="app"></div>
  
  <script src="https://unpkg.com/xstream@10.9.0/dist/xstream.js"></script>
  <script>window.xs=xstream.default</script>
  <script src="script.js"></script>
</body>
</html>
</html>
xs.periodic(1000)                  // ---!---!---!---!---
.fold(prev => prev + 1, 0)         // 0--1---2---3---4---
.map(i => `Seconds elapsed: ${i}`)
.subscribe({
    next: str => {
        const elem = document.querySelector('#app');
        elem.textContent = str;
    }
})