<s> from rx import Observable <EOL> from rx . subjects import BehaviorSubject <EOL> from rx . internal import extensionmethod <EOL> @ extensionmethod ( Observable ) <EOL> def publish_value ( self , initial_value , selector = None ) : <EOL> """<STR_LIT>""" <EOL> if selector : <EOL> def subject_selector ( ) : <EOL> return BehaviorSubject ( initial_value ) <EOL> return self . multicast ( subject_selector = subject_selector , <EOL> selector = selector ) <EOL> else : <EOL> return self . multicast ( BehaviorSubject ( initial_value ) ) </s>
