index.html 559 B

1234567891011121314151617181920212223
  1. <html>
  2. <head>
  3. <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.js" defer></script>
  4. </head>
  5. <body>
  6. <div x-data>
  7. <span x-text="$store.foo.bar"></span>
  8. </div>
  9. <script src="/dist/spruce.umd.js"></script>
  10. <script>
  11. window.starting = 0;
  12. window.started = 0;
  13. Spruce.starting(() => window.starting++)
  14. Spruce.store('foo', { bar: 'car' })
  15. Spruce.started(() => window.started++)
  16. </script>
  17. </body>
  18. </html>