reset Method

Resets the state to its original value that was set during initialization. This is useful for reverting the state back to its starting condition, discarding any changes that have occurred since the state was first established

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

API

reset(): this;

Example

import {state} from '@bitfiber/rx';
 
const data = state<number>(10);
 
data.set(20);
 
// Resets the current state to initial value '10'
data.reset();