StoreReferenceStateuseLazyEmission

useLazyEmission Method

Enables lazy emission for the state, meaning that the state will defer emitting its initial value to subscribers until an explicit trigger occurs. This can be useful in scenarios where you want more control over when the state emits its value, rather than emitting immediately

@returns this
The instance of the current state, allowing for method chaining

API

useLazyEmission(): this;

Example

import {state} from '@bitfiber/rx';
 
const data = state<number>(0, s => s
  // Forces the state not to emit a value at the time of subscription
  .useLazyEmission());