npm.io
1.0.0 • Published 4 years ago

vasm

Licence
MIT
Version
1.0.0
Deps
0
Size
2 kB
Vulns
0
Weekly
0

vasm.ts

Vue.js based framework build on the power of AssemblyScript

Why Vasm?

Vasm takes everything great about Vue and takes it to the WebAssembly realm. Using AssemblyScript, components/state/pages can be written to be high performing while being written in a language that is familiar to JavaScript developers. Furthermore, external Vue.js components can be hooked into Vasm, opening up the enormous Vue ecosystem to the power of WebAssembly.

Example

Vasm is similair to Vue.js in syntax (Although due to its low level, certain aspects require extra steps). Example of a simple button counter.

import { Vasm } from 'vasm';
import { Map } from 'map';

Vasm.Component("App", Vasm.Options()
    .template(`
        <div>
            <button :click="counter:i32++">
                Clicked the button {{ counter }} times.
            </button>
        </div>
    `)
    .data( (instance: Pointer<Instance>, data: Pointer<Data>) : void => {

        // The data object is passed as a pointer.
        of(data).set("counter", 0);

    })
);