Slide 17
Slide 17 text
MobX
class Timer {
constructor() {
extendObservable(this, {
start: Date.now(),
current: Date.now(),
get elapsedTime() {
return (this.current - this.start)
},
tick: action(function() {
this.current = Date.now()
})
})
}
}
FYUFOE0CTFSWBCMFؔΛͬͯ
PCTFSWBCMFʹ͍ͯ͠Δ