Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WeakRef and FinalizationRegistry#576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dolgachio merged 14 commits intojavascript-tutorial:masterfromWOLFRIEND:master
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
dac5f5e
Add WeakRef and FinalizationRegistry article
WOLFRIENDNov 6, 2023
174a388
Add WeakRef and FinalizationRegistry article
WOLFRIENDNov 6, 2023
5c3727f
Merge remote-tracking branch 'origin/master'
WOLFRIENDFeb 21, 2024
b9b5d36
Merge remote-tracking branch 'upstream/master'
WOLFRIENDFeb 21, 2024
9dbb150
Apply suggestions from code review
dolgachioFeb 22, 2024
f70ad91
Apply suggestions from code review
dolgachioFeb 25, 2024
dbeccd2
Update 1-js/99-js-misc/07-weakref-finalizationregistry/article.md
dolgachioFeb 25, 2024
0dfb2cd
Apply suggestions from code review
dolgachioFeb 25, 2024
aefe92e
Apply suggestions from code review
dolgachioFeb 26, 2024
3cfd4ce
Apply suggestions from code review
dolgachioFeb 26, 2024
02ad1a6
Apply suggestions from code review
dolgachioFeb 27, 2024
c17f720
Apply suggestions from code review
dolgachioFeb 28, 2024
caa4f50
Apply suggestions from code review
dolgachioMar 1, 2024
f48c593
Apply suggestions from code review
dolgachioMar 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
424 changes: 212 additions & 212 deletions1-js/99-js-misc/07-weakref-finalizationregistry/article.md
View file
Open in desktop

Large diffs are not rendered by default.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
<!DOCTYPE HTML>
<html lang="en">
<html lang="uk">

<head>
<meta charset="utf-8">
<link rel="stylesheet" href="index.css">
<title>WeakRef DOMLogger</title>
<title>WeakRef DOMЛогер</title>
</head>

<body>

<div class="app">
<button class="start-messages">Start sending messages</button>
<button class="start-messages">Почати відправку повідомлень</button>
<div class="window">
<div class="window__header">
<p class="window__title">Messages:</p>
<button class="window__button">Close</button>
<p class="window__title">Повідомлення:</p>
<button class="window__button">Закрити</button>
</div>
<div class="window__body">
No messages.
Немає повідомлень.
</div>
</div>
</div>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,16 +9,15 @@ startMessagesBtn.addEventListener('click', () => { // (4)

closeWindowBtn.addEventListener('click', () => document.querySelector(".window__body").remove()); // (5)


const startMessages = (element) => {
const timerId = setInterval(() => { // (6)
if (element.deref()) { // (7)
const payload = document.createElement("p");
payload.textContent = `Message: System status OK: ${new Date().toLocaleTimeString()}`;
payload.textContent = `Повідомлення: Статус системи OK: ${new Date().toLocaleTimeString()}`;
element.deref().append(payload);
} else { // (8)
alert("The element has been deleted."); // (9)
alert("Елемент було видалено."); // (9)
clearInterval(timerId);
}
}, 1000);
};
};
Loading

[8]ページ先頭

©2009-2025 Movatter.jp