Changing a reactive source notifies its subscribers.
Assignment
count $Int = 0
count = 1
Assigning to count updates the source. Anything subscribed to count will know it may need to update.
Mutable collection source
names ${String} = {"Priya"}
~names.push("Grace") catch:
io.line("push failed")
;
You need ~ to mutate the collection. Reactivity does not relax the access rules. Fallible operations like push must be handled with catch or propagated inside a compatible Error! function.
Mutating a reactive source updates the same stable storage and invalidates its subscribers.
Assignment
count $Int = 0
count = 1
Assignment updates the same stable source. Subscribers to that source are marked invalid.
Invalidation in V1
Mutation through a source invalidates the whole source in V1. Invalidating operations include:
- assignment
- field writes
- collection mutation
- map mutation
- mutable write-through calls
Field, item and path-level invalidation are deferred.
Mutation still follows access rules
names ${String} = {"Priya"}
~names.push("Grace") catch:
io.line("push failed")
;
Mutation still requires explicit ~ for mutable or exclusive receiver access. Reactive syntax does not bypass ordinary borrowing. Fallible mutations must be handled with catch or propagated inside a compatible Error! function. Top-level ! propagation is rejected when no error channel exists.
Subscriptions are not borrows
A subscription is a read-only dependency record. It does not capture a mutable borrow, copy the value or extend a source-language lifetime. Subscriptions do not block later valid mutable access by themselves.
Borrow validation
Borrow validation records source dependencies and conservative invalidation facts. Reactive metadata is separate from active borrow lifetimes.
Related concepts