Platform
Resources
Pricing
Sign in
Get started
nuandawm
Workspace
Fork
Public
By
nuandawm
Edited
Feb 26, 2024
Fork of
Input + Chart
•
1 fork
1
Insert cell
Insert cell
Insert cell
Insert cell
initialUnseen
=
11
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
actions
=
[
loadPageAction
(
0
)
,
markSeenAction
(
0
)
,
loadPageAction
(
1
)
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
loadPageAction
=
function
(
pageNumber
)
{
return
(
)
=>
{
mutable
loadedPosts
=
mutable
loadedPosts
.
concat
(
apiSort
(
mutable
apiPosts
)
.
filter
(
(
p
,
i
)
=>
(
i
>=
pageNumber
*
postsPerPage
)
&&
(
i
<
(
pageNumber
+
1
)
*
postsPerPage
)
)
)
}
}
Insert cell
markSeenAction
=
function
(
pageNumber
)
{
return
(
)
=>
{
mutable
apiPosts
=
mutable
apiPosts
.
map
(
(
post
,
i
)
=>
(
{
...
post
,
unseen
:
(
i
>=
pageNumber
*
postsPerPage
)
&&
(
i
<
(
pageNumber
+
1
)
*
postsPerPage
)
?
false
:
post
.
unseen
}
)
)
}
}
Insert cell
Insert cell
apiSort
=
function
(
posts
)
{
return
posts
.
toSorted
(
(
post1
,
post2
)
=>
{
if
(
!
post1
.
unseen
&&
post2
.
unseen
)
{
return
1
;
}
else
if
(
post1
.
unseen
&&
!
post2
.
unseen
)
{
return
-
1
;
}
return
0
;
}
)
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mutable
eyeIndex
=
42
;
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
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
postsListSize
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
postsPerPage
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
initialUnseen
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
initialPosts
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
apiPosts
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
loadedPosts
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
postsToShow
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
actionInProgress
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
actions
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
replay
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
refresh
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
refreshEvent
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
loadPageAction
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
markSeenAction
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
apiSort
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
_
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
url
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
node
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bbox
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
icon
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
eyeIndex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML