I implemented the Observable class, which stores a list of all observers. Should this list contain weak references to observers to prevent memory leaks?
What is common practice?
Not necessarily, it depends on the context. Some observers may simply want to do simple things, such as logging, etc., and would rather stay alive with an Observable. It is best to do this in order to clearly document your choice, so that observers know if they need to explicitly allow themselves.
, Rx, IObservable .NET 4, Subscribe Subject, . On* .
IObservable
Subscribe
Subject
On*
, , . , , Subscribe, Rx (, Take TakeUntil).
Take
TakeUntil
Source: https://habr.com/ru/post/1792520/More articles:Iphone page curl option - iphoneУдалить объект - c#PhoneGap + jQuery Mobile HTML5 Access Sqlite Database Problem in Android 2.1 - jqueryGwt tag background color - background-colorBoost multi_index: retrieves unique values of a non-unique key - c ++Android: EditText next to ImageView - EditText as wide as possible - androidhow to force show login window using Windows Intergrated autentication - securityHow to get the name of the OS in which the code works using C #? - c #strange behavior cout << Boost :: posix_time - c ++How to find identical files without comparing them with eachother? - comparisonAll Articles