🧩 10 травня о 15:00 стрім «Мінімум патернів для максимуму користі у реальному проекті»
Deep dive into 5 most useful patterns: Strategy, Factory, Pool, Queue, Adapter
👉 https://patterns-js.com/p2brao?utm_source=telegram_channel&utm_medium=t_shemsedinov&utm_campaign=stream_10_05
Deep dive into 5 most useful patterns: Strategy, Factory, Pool, Queue, Adapter
👉 https://patterns-js.com/p2brao?utm_source=telegram_channel&utm_medium=t_shemsedinov&utm_campaign=stream_10_05
This week topic for Node.js 2025: Disposable objects
Examples: https://github.com/HowProgrammingWorks/Disposable
Please open Telegram to view this post
VIEW IN TELEGRAM
Лекцію по using я перепишу, там помилка, а код можна подивитися тут
https://github.com/HowProgrammingWorks/Disposable
Подяка Dmytro Shchehlov за коменти
https://github.com/HowProgrammingWorks/Disposable
Подяка Dmytro Shchehlov за коменти
GitHub
GitHub - HowProgrammingWorks/Disposable: Explicit Resource Management
Explicit Resource Management. Contribute to HowProgrammingWorks/Disposable development by creating an account on GitHub.
'use strict';
// node.js 24 required
const fs = require('node:fs');
const timers = require('timers/promises');
const { Console } = require('node:console');
class RefCount {
#resource = null;
#dispose = null;
#context = null;
#count = 0;
constructor(create, dispose) {
this.#dispose = dispose;
return this.#init(create);
}
async #init(create) {
const { resource, context } = await create();
this.#resource = resource;
this.#context = context;
return this;
}
use() {
console.log('👉 Use');
this.#count++;
const disposable = Object.create(this.#resource);
disposable[Symbol.asyncDispose] = async () => {
console.log('👉 Dispose');
this.#count--;
if (this.#count > 0) return;
await this.#dispose(this.#resource, this.#context);
this.#resource = null;
this.#context = null;
};
return disposable;
}
}
const main = async () => {
const logger = await new RefCount(
async () => {
const file = './output.log';
const stream = await fs.createWriteStream(file);
const resource = new Console({ stdout: stream });
console.log(`👉 Open: ${file}`);
return { resource, context: { file, stream } };
},
async (resource, context) => {
console.log(`👉 Close: ${context.file}`);
await context.stream.close();
},
);
// Block 0
{
await using console = logger.use();
console.log('Log 1');
// Block 1
{
await using console = logger.use();
console.log('Log 1');
}
// Block 2
{
await using console = logger.use();
console.log('Log 2');
}
await timers.setTimeout(1000);
}
};
main().then(() => {
console.log('After main');
});
Repo: https://github.com/HowProgrammingWorks/Disposable/blob/main/JavaScript/7-ref-count.js
Продовження https://youtu.be/ZDdyyOBFsXI
YouTube
💡 Reference counting with Using & Disposable in JavaScript, TypeScript, Node.js українською
👉 Examples: https://github.com/HowProgrammingWorks/Disposable
👉 TC39 proposal: https://github.com/tc39/proposal-explicit-resource-management
👉 ECMAScript specs: https://tc39.es/proposal-explicit-resource-management/
👉 Node.js 24 release notes: https:/…
👉 TC39 proposal: https://github.com/tc39/proposal-explicit-resource-management
👉 ECMAScript specs: https://tc39.es/proposal-explicit-resource-management/
👉 Node.js 24 release notes: https:/…
У новому курсі записано вже 19 лекцій:
1. Introduction
2. Layered (onion), DDD, Clean architecture
3. App structure, Modularity, DI, unittesting
4. DTOs, models, race conditions
5. Hexagonal Architecture, ports and adapters architecture
6. Clustering, Parallel, Distributed systems, CAP, ACID, BASE, Locking, CQRS
7. Actor Model
8. Databases, data modeling
9. Domain Specific Languages: DSL, AST, LISP
10. Command, QueryObject, CQS, CQRS, EventSourcing
11. Messaging: MQ, Pub/Sub, Pull
12. System integration and topology: API, bus, brocker, MQ
13. Communication styles: data, call, event, log sync, p2p, blockchain
14. Feature-Sliced Design
15. Architecture for Web: DDD for Frontend and Backend
16. Data access patterns
17. Asynchronous programming
18. Imperative shell, Functional core
19. Multi-paradigm programming in Architecture
20. Metaprogramming
Влітку вийде у такому складі, але восени із додаткових тем ще 10 переїде у основний курс.
Слідкувати за станом справ можна тут https://github.com/HowProgrammingWorks/Index/blob/master/Courses/Architecture-2025.md
Please open Telegram to view this post
VIEW IN TELEGRAM
«Розквіт» 5 June, 19:00 https://maps.app.goo.gl/5wK357ZmwWxnq9rr9
Please open Telegram to view this post
VIEW IN TELEGRAM
- монадичні обчислення у синтаксисі класів
- монадичні обчислення у синтаксисі прототипів
- монадичні обчислення у синтаксисі замикань
- монадичні обчислення з універсальним контейнером
- ізоляція виводу у монаду IO
- ізоляція читання та виводу у монаду IO
- ізоляція читання та виводу + універсальний монадичний контейнер
Examples: https://github.com/HowProgrammingWorks/Paradigms/tree/main/JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
https://github.com/HowProgrammingWorks/Paradigms/tree/main/JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from HowProgrammingWorks - JavaScript and Node.js Programming