File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
main/java/com/vaadin/flow/signals/shared
test/java/com/vaadin/flow/signals/shared Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -121,13 +121,14 @@ public Double peekConfirmed() {
121121 }
122122
123123 /**
124- * Gets the value of this signal as an integer without registering a
125- * dependency. Equivalent to {@code peek().intValue()}.
124+ * Gets the value of this signal as an integer. This method works in the
125+ * same way was {@link #get()} with regards to transactions and dependency
126+ * tracking.
126127 *
127128 * @return the signal value as an integer
128129 */
129130 public int getAsInt () {
130- return peek ().intValue ();
131+ return get ().intValue ();
131132 }
132133
133134 /**
Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ void incrementBy_concurrentIncrements_allIncrementsConsidered() {
7171 @ Test
7272 void getAsInt_decimalValue_valueIsTruncated () {
7373 SharedNumberSignal signal = new SharedNumberSignal (2.718 );
74-
75- assertEquals ( 2 , signal .getAsInt ());
74+ assertEquals ( 2 ,
75+ Signal . runInTransaction (() -> signal .getAsInt ()). returnValue ());
7676 }
7777
7878 @ Test
You can’t perform that action at this time.
0 commit comments