Platform
Resources
Pricing
Sign in
Get started
binarmaya
Workspace
Fork
Published
By
binarmaya
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.
Try it for free
Learn more
Fork
View
Export
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
SomeArr
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
UpdateSomeArray
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
UpdateSomeArrFunc
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Abc
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML