Should I change all temporary_assigns to stream in liveview?

Hi, recently I have read this post Phoenix Dev Blog - Streams · Fly based on stream benefit especially in delete section, there is a question: Should I change all temporary_assigns to stream in liveview? And the temporary_assigns will be deprecated?
Thanks

I updated recently and its a much cleaner and better Dx

2 Likes

Are streams the replacement for temporary assigns?

Essentially, yes, but I don’t know if temporary assigns are ever going to be deprecated or not.

1 Like

You could still use temporary assigns for “cached” dynamic values that wouldn’t change without a refresh. I can’t think of a really good example but like, say you were displaying the user’s country on some pages where it couldn’t be edited. While the memory savings are minuscule here, you could always assign it and throw it away after first render.

1 Like