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

Ternary State

Handling Boolean State

Often times with Javascript we use boolean as variables, but usually when parsing the result to DOM we want it in a different form. In this case we use ternary operator as our state expression i.e {{<state>?<truthy>:<falsy>}}.

import Keet from 'keet'

class App extends Keet {
  el = 'app'
  status = false
  render(){
    return 'Hello {{status?World:Keet}}'
  }
}

const app = new App()

Codepen Sample

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

← PreviousNext →
  • Handling Boolean State
  • Codepen Sample
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