| 50 | * @public |
| 51 | */ |
| 52 | export interface Atom<Value, Diff = unknown> extends Signal<Value, Diff> { |
| 53 | /** |
| 54 | * Sets the value of this atom to the given value. If the value is the same as the current value, this is a no-op. |
| 55 | * |
| 56 | * @param value - The new value to set. |
| 57 | * @param diff - The diff to use for the update. If not provided, the diff will be computed using {@link AtomOptions.computeDiff}. |
| 58 | */ |
| 59 | set(value: Value, diff?: Diff): Value |
| 60 | /** |
| 61 | * Updates the value of this atom using the given updater function. If the returned value is the same as the current value, this is a no-op. |
| 62 | * |
| 63 | * @param updater - A function that takes the current value and returns the new value. |
| 64 | */ |
| 65 | update(updater: (value: Value) => Value): Value |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Internal implementation of the Atom interface. This class should not be used directly - use the {@link atom} function instead. |
no outgoing calls
no test coverage detected
searching dependent graphs…