Published
Edited
May 22, 2020
1 star
Insert cell
md`# Example of Promises.tick and Mutable Variabel`
Insert cell
mutable SomeArr =[]
Insert cell
viewof UpdateSomeArray = {
let AlwaysRun = true
while(AlwaysRun){
//debugger
yield Promises.tick(5000, UpdateSomeArrFunc(5));
}
}
Insert cell
UpdateSomeArrFunc= (add)=> {
debugger
if(SomeArr.length>0){
return mutable SomeArr.push(SomeArr[SomeArr.length-1]+add)
debugger
} else {
return mutable SomeArr.push(add)
}
}
Insert cell
Abc = {
if(SomeArr.length>0){return true} else { return false}
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more