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

Functor State

Working with Functor State

A state also may accept return values from its class constructor methods. To use it apply keyword this i.e {{this.<myMethod>}}

NOTE: Though they are passive, we can invoke Keet.prototype.callBatchPoolUpdate() to update a function state.

import Keet from 'keet'

class App extends Keet {
  el = 'app'
  myMethod() {
    return 1 + 1
  }
  render(){
    return 'Total of: 1 + 1 = {{this.myMethod}}'
  }
}

const app = new App()

Codepen Sample

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

← PreviousNext →
  • Working with Functor 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