Keet.js v4.2.1

Keet.js v4.2.1

  • Docs
  • API
  • Help

›General Guideline

General Guideline

  • Introduction
  • Hello World
  • Ternary State
  • Functor State
  • Counter (eventListener)
  • Dynamic Nodes
  • List
  • List (advance)
  • Component

Hello World

Basic

Start by constructing a class expression as child of Keet. Supply a string argument to the component method mount. Within the string, you can assign a state within handlebars i.e: {{<myState>}}.

import Keet from 'keet'

class App extends Keet {
  el = 'app'
  state ='World'
  render() {
    return 'Hello {{state}}'
  }
}

const app = new App()

Codepen Sample

See the Pen Keetjs - Hello World by Shahrul Nizam b. Selamat (@syarul) on CodePen.

Updating a State

To update a state write a method in our class Expression that accept an argument.

import Keet from 'keet'

class App extends Keet {
  el = 'app'
  state ='World'
  // our method
  greeting(value) {
    this.state = value
  }
  render() {
    return 'Hello {{state}}'
  }
}

const app = new App()

Then we can update the state by invoking the method.

app.greeting('Keet')

Codepen Sample (updating state)

See the Pen Keetjs - Hello World ( updating state) by Shahrul Nizam b. Selamat (@syarul) on CodePen.

← PreviousNext →
  • Basic
  • Codepen Sample
  • Updating a State
  • Codepen Sample (updating state)
Keet.js v4.2.1
Extra
TodoMVCPerformance Benchmark
Community
Gitter Chat
on Github
Star  Fork  Issue

Generated with Docusaurus

Docusaurus
Copyright © 2018 Shahrul Nizam Selamat