# set abstract method

void set(

1. T? newValue, {
2. bool force = false,

})

Replace the current value and emit a ValueChanged event.

If the new value is identical to the old value, no event will be emitted unless `force` is `true`.

### Example

    final obs = Obs<int>(1);
    obs.listen((event) => print(event));

    obs.set(2); // Emits ValueChanged(1 -> 2)
    obs.set(2); // Does not emit (same value)
    obs.set(2, force: true); // Forces emission

## Implementation

    void set(T? newValue, {bool force = false});