Class IntrospectUtil
java.lang.Object
react4j.internal.IntrospectUtil
Utilities for introspecting the React4j views and runtime.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcollectDependencyDebugData(arez.Observer observer, jsinterop.base.JsPropertyMap<@Nullable Object> data) For the specified observer, collect all dependencies and record them in data to be emitted as debug data.static @Nullable ObjectgetValue(arez.spy.ObservableValueInfo observableInfo) Return the value for specified observable.static booleanprepareStateUpdate(jsinterop.base.JsPropertyMap<@Nullable Object> newState, @Nullable jsinterop.base.JsPropertyMap<@Nullable Object> currentState) Prepare the newState value to be updated given specified current state.
-
Method Details
-
getValue
Return the value for specified observable. Exceptions are caught and types are converted to strings usingObject.toString()- Parameters:
observableInfo- the observable.- Returns:
- the value as a string.
-
collectDependencyDebugData
public static void collectDependencyDebugData(arez.Observer observer, jsinterop.base.JsPropertyMap<@Nullable Object> data) For the specified observer, collect all dependencies and record them in data to be emitted as debug data.- Parameters:
observer- the observer.data- the target in which to place debug data.
-
prepareStateUpdate
public static boolean prepareStateUpdate(jsinterop.base.JsPropertyMap<@Nullable Object> newState, @Nullable jsinterop.base.JsPropertyMap<@Nullable Object> currentState) Prepare the newState value to be updated given specified current state. If no changes are required then return false.- Parameters:
newState- the new "state" of the view.currentState- the current "state" of the view.- Returns:
- true if newState needs to be saved to native view, false otherwise.
-