1234567891011121314151617 |
- (lambda widget (closure)
- (var Widget (lambda (options)
- (if (! (instanceof this Widget)) (return (new Widget options)))
- (= this.options options)))
- (= Widget.prototype.type "Widget")
- (= Widget.prototype.init (lambda ()
- (= this.state (closure this.options))
- (return this.state.element)))
- (= Widget.prototype.update (lambda (prev)
- (= this.state prev.state)
- (return (?: this.state.update
- (this.state.update.apply this arguments) null))))
- (= Widget.prototype.destroy (lambda ()
- (if this.state.destroy (this.state.destroy.apply this arguments))))
- (return (lambda (options)
- (return (new Widget options)))))
|