From 369af89ee527416b24bf5d3a4e48b979e96275de Mon Sep 17 00:00:00 2001 From: russelljtdyer <6652767+russelljtdyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 09:44:41 +0100 Subject: [PATCH] First pass at editing new text, only. --- articles/hilla/guides/full-stack-signals.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/articles/hilla/guides/full-stack-signals.adoc b/articles/hilla/guides/full-stack-signals.adoc index 605651481c..fd84342dbb 100644 --- a/articles/hilla/guides/full-stack-signals.adoc +++ b/articles/hilla/guides/full-stack-signals.adoc @@ -300,7 +300,7 @@ Since [classname]`NumberSignal` is a [classname]`ValueSignal` with the additiona [role="since:com.vaadin:vaadin@V24.6"] === ListSignal -The [classname]`ListSignal` is a full-stack signal that holds a list of values of an arbitrary type. It has to be a JSON-serializable type that's supported by the Hilla framework. Every item in a [classname]`ListSignal` is a [classname]`ValueSignal`, meaning that any changes to the item's value is propagated to the server and other clients automatically. +The [classname]`ListSignal` is a full-stack signal that holds a list of values of an arbitrary type. It has to be a JSON-serializable type that's supported by the Hilla framework. Every item in a [classname]`ListSignal` is a [classname]`ValueSignal`, meaning that any changes to the item's value is propagated to the server and other clients. The following example demonstrates how to create and use a [classname]`ListSignal` in a server-side service: @@ -599,7 +599,7 @@ public interface OperationValidator { The [methodname]`validate` method takes a [classname]`SignalOperation` instance as a parameter and returns a [classname]`ValidationResult`. The [classname]`SignalOperation` is a common interface for all operations that can be applied to a signal. The [classname]`ValidationResult` is used to communicate the result of the validation, containing: - A `status` with two possible enumerated values, `ALLOWED` and `REJECTED`; and -- A `message` that can be used to provide a reason for the rejection. Considering the nature of operation validators as a security point cut, this message is only logged on server side (at `WARN` level), and it is not propagated to the client to prevent any possible misuse. +- A `message` that can be used to provide a reason for the rejection. Considering the nature of operation validators as a security point cut, this message is only logged on the server side (i.e., at `WARN` level), and it's not propagated to the client to prevent any possible misuse. The [classname]`ValidationResult` class provides two convenient static methods to create instances of the class: @@ -625,16 +625,16 @@ NumberSignal voteSignal = new NumberSignal() // <1> <1> Creates an instance of a [classname]`NumberSignal` that defaults to zero. <2> Defines an operation validator on the signal instance, which results in a new signal instance with the operation validator attached. The original instance remains unchanged (i.e., no validators). <3> Checks the operation type to be only an `IncrementOperation`. -<4> Allow the operation only if the value is incremented/decremented by `1.0`. +<4> Allows the operation only if the value is incremented or decremented by `1.0`. <5> Rejects the operation if the value is not `1.0` or `-1.0`. -<6> Rejects all other operations, in this case the could be `SetValueOperation` and `ReplaceValueOperation`. +<6> Rejects all other operations, which could be `SetValueOperation` and `ReplaceValueOperation`. In the above example, the `operation` parameter is an instance of [classname]`SignalOperation`. At runtime, the operation can be one of the following types: `ValueOperation`:: Represents an operation that contains a value of type `T`. `IncrementOpertaion`:: Specific to `NumberSignal`. Represents an operation that increments the value of the signal by a given value. Value is of Type `Double`. This operation is a special case of [classname]`ValueOperation`. -`SetValueOperation`:: Specific to `ValueSignal` and `NumberSignal`. Also, applies to the changes happening to the items of a `ListSignal`. Represents an operation that sets the value of the signal to a new value of type `T`. This operation is a special case of [classname]`ValueOperation`. -`ReplaceValueOperation`:: Specific to `ValueSignal` and `NumberSignal`. Also, applies to the changes happening to the items of a `ListSignal`. Represents an operation that replaces the value of the signal with a new value of type `T`. This operation is a special case of [classname]`ValueOperation`. +`SetValueOperation`:: Specific to `ValueSignal` and `NumberSignal`. Also, applies to changes happening to the items in a `ListSignal`. Represents an operation that sets the value of the signal to a new value of type `T`. This operation is a special case of [classname]`ValueOperation`. +`ReplaceValueOperation`:: Specific to `ValueSignal` and `NumberSignal`. Also, applies to the changes happening to the items in a `ListSignal`. Represents an operation that replaces the value of the signal with a new value of type `T`. This operation is a special case of [classname]`ValueOperation`. `ListInsertOperation`:: Specific to `ListSignal`. Represents an operation that inserts a new value to the list signal at a given position. The value is of type `T`. This operation is a special case of [classname]`ValueOperation`. `ListRemoveOperation`:: Specific to `ListSignal`. Represents an operation that removes a value from the list signal at a given position. The value is of type `T`.