@igojs/component
v6.1.1
Published
Reactive components with SSR for Igo.js
Downloads
1,062
Maintainers
Readme
@igojs/component
Reactive single-file components with SSR for Igo.js. One .dust file with <script> + template, deep reactivity via Proxy, automatic hydration, DiffDOM reconciliation.
Install
npm install @igojs/componentQuick start
A component is one .dust file:
{! views/components/Counter.dust !}
<script>
({
props: { initial: 0 },
state: { count: 0 },
get doubled() { return this.state.count * 2; },
onIncrement() { this.state.count++; }
})
</script>
<div>
<p>Count: {count} (×2 = {doubled})</p>
<button on:click="onIncrement">+1</button>
</div>Render it server-side from any Dust template:
{@component "components/Counter" initial=5 /}In your client entry:
const { start } = require('@igojs/component/client');
start();Documentation
Full documentation: https://igocreate.github.io/igo/component/getting-started
License
ISC
