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.