update async-pipe-is-not-pure to encode gifs as mp4s

This commit is contained in:
James Fenn
2023-03-19 19:40:27 -04:00
parent 2d3dcdbfe9
commit b69bcd0d98
5 changed files with 2 additions and 3 deletions

View File

@@ -134,7 +134,7 @@ The moment we set the **pure** option to be **false**, we tell Angular that we w
If we run the code we will see something like this:
![Not working solution](./not_working_example.gif)
<video title="Not working solution" src="./not_working_example.mp4"></video>
The reason why it does that is because every time change detection runs, the pipe will subscribe to our observable and let the other subscription in memory, and of course **create a memory leak**!
@@ -166,8 +166,7 @@ transform(obs: Subscribable<T> | null): T | null {
If we check the app now, we will see that it works fine! But its not finished!
![Working solution](./working_example.gif)
<video title="Working solution" src="./working_example.mp4"></video>
Because we still cause a memory leak, because we never unsubscribe from the observable! Lets do it!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB