@igojs/component
v6.6.1
Published
Reactive components with SSR for Igo.js
Readme
@igojs/component
Deprecated. Maintained for the applications that use it — bug fixes, compatibility with the other igo packages — but no new features, and removed in a future major version. For a new interactive interface, start from the
fullstackskeleton (npx @igojs/server create myapp --skel=fullstack): a React SPA on an igo JSON API.
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
