---
title: "Discussion on \"Clean Architecture in Frontend\" | Hashnode"
description: "Discussion on \"Clean Architecture in Frontend\". A little theory and an open-source example"
url: "https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Clean Architecture in Frontend](https://blog.alexeykarpov.com/clean-architecture-in-frontend?utm_source=hashnode&utm_medium=feed)

A little theory and an open-source example

Jul 25, 2022 · 8 min read · blog.alexeykarpov.com  
Read the article

-   [#clean-architecture](https://hashnode.com/tag/clean-architecture)
-   [#angular](https://hashnode.com/tag/angular)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)
-   [#state-management](https://hashnode.com/tag/state-management)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Alexey Karpov](https://hashnode.com/@karpovad)

@karpovad

  
[View profile](https://hashnode.com/@karpovad)

Writing about frontend development and other things that sparkle my interest

## Responses 5

Markdown supported · ⌘↵ to post

[saeed baghestani](https://hashnode.com/@Saeedbaghestani)

[Jun 22, 2023](https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9/comment/64943ed6f012983651c3211d)

This article was very helpful for me, of course I am new to this field and need to spend more time learning and experiencing to be able to give a better opinion and along the way I hope to use your knowledge.

[danial Vafadar](https://hashnode.com/@DanialV)

[Sep 24, 2022](https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9/comment/632f4c943ac18d0d78a02708)

Nice work but I have a question about the facade layer as you mentioned you subscribe to your subject in order to make sure that fresh data is available inside the subject but what about destroying that subscription doesn't it create a memory leak because whenever we call the facade method it will create a subscription and that subscription will always be on the memory how to handle this case?

[Alexey Karpov](https://hashnode.com/@karpovad)

[Feb 4, 2023](https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9/comment/632f4c943ac18d0d78a02708#reply-63de163c2f21c58845cbdb44)

Hi, I’m sorry for the very late answer. That’s a good question. In general case such subscription should be treated with extra care, e.g. we always need to precisely know when to unsubscribe. In this case I have an observable that emits only 1 value, when HTTP request is done. Essentially this facade says “no matter what, the request shouldn’t be cancelled”. I don’t apply this same solutions to all the components and facades. Whenever it’s possible, I subscribe as close to the data rendering as possible, ideally in the HTML template.

[Umair Hafeez](https://hashnode.com/@umairhafeez)

[Aug 18, 2022](https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9/comment/62fdb0580cfd6de8c7d79a15)

This is brilliantly put together. Thank you for sharing [Alexey Karpov](https://hashnode.com/@karpovad)!

[John Tarus](https://hashnode.com/@tarus)

[Jul 28, 2022](https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9/comment/62e2c70dd15a9fb24e51776b)

cool piece.

[Chibuzo Odigbo](https://hashnode.com/@Franklivania)

[Jul 26, 2022](https://hashnode.com/posts/clean-architecture-in-frontend/62de5b90790e138f3d3959b9/comment/62dfa4f7790e138f3d398abf)

Impacting. Do you have any work on the full implementation of todos, it's dos and don'ts in react?
