mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
update async-pipe-is-not-pure to encode gifs as mp4s
This commit is contained in:
@@ -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:
|
||||
|
||||

|
||||
<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 it’s not finished!
|
||||
|
||||

|
||||
|
||||
<video title="Working solution" src="./working_example.mp4"></video>
|
||||
|
||||
Because we still cause a memory leak, because we never unsubscribe from the observable! Let’s do it!
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 149 KiB |
BIN
content/blog/async-pipe-is-not-pure/not_working_example.mp4
Normal file
BIN
content/blog/async-pipe-is-not-pure/not_working_example.mp4
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 150 KiB |
BIN
content/blog/async-pipe-is-not-pure/working_example.mp4
Normal file
BIN
content/blog/async-pipe-is-not-pure/working_example.mp4
Normal file
Binary file not shown.
Reference in New Issue
Block a user