Struct observable_react::observable::ReactObservable
source · [−]pub struct ReactObservable { /* private fields */ }
Expand description
Wrapper around JsObserve to which provides React binding convenience methods
The JsObserve trait, and this wrapper are necessary because wasm_bindgen cannot express generics at this time.
Implementations
sourceimpl ReactObservable
impl ReactObservable
pub fn get(&self) -> JsValue
pub fn map(&self, cb: Function) -> JsValue
sourcepub fn bind_component(&mut self, component: ReactComponent)
pub fn bind_component(&mut self, component: ReactComponent)
Bind this observable to a React component for class-based react components
pub fn unbind(&mut self)
pub fn subscribe(&mut self, cb: Function) -> Function
pub fn destroy(&self)
pub fn value(&self) -> JsValue
pub fn load(&self) -> Promise
Trait Implementations
sourceimpl<O> From<O> for ReactObservable where
O: JsObserve + 'static + Sized,
impl<O> From<O> for ReactObservable where
O: JsObserve + 'static + Sized,
sourceimpl From<ReactObservable> for JsValue
impl From<ReactObservable> for JsValue
sourcefn from(value: ReactObservable) -> Self
fn from(value: ReactObservable) -> Self
Converts to this type from the input type.
sourceimpl FromWasmAbi for ReactObservable
impl FromWasmAbi for ReactObservable
sourceimpl IntoWasmAbi for ReactObservable
impl IntoWasmAbi for ReactObservable
sourceimpl OptionFromWasmAbi for ReactObservable
impl OptionFromWasmAbi for ReactObservable
sourceimpl OptionIntoWasmAbi for ReactObservable
impl OptionIntoWasmAbi for ReactObservable
sourceimpl RefFromWasmAbi for ReactObservable
impl RefFromWasmAbi for ReactObservable
type Anchor = Ref<'static, ReactObservable>
type Anchor = Ref<'static, ReactObservable>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
sourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for ReactObservable
impl RefMutFromWasmAbi for ReactObservable
type Anchor = RefMut<'static, ReactObservable>
type Anchor = RefMut<'static, ReactObservable>
Same as RefFromWasmAbi::Anchor
sourceunsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as RefFromWasmAbi::ref_from_abi
sourceimpl WasmDescribe for ReactObservable
impl WasmDescribe for ReactObservable
Auto Trait Implementations
impl !RefUnwindSafe for ReactObservable
impl !Send for ReactObservable
impl !Sync for ReactObservable
impl Unpin for ReactObservable
impl !UnwindSafe for ReactObservable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcefn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more