JsRef class
A reference to deal with the updating and retrieving the valye of a JavaScript object inside JavaScript runtime.
Constructors
- JsRef(JsContext context, String ns, String key)
- JsRef.define(JsContext context, String ns, String updater)
-
Defines a reference with a {updater} that change the value.
the updater is a pure Javascript string.
factory
- JsRef.generate(JsContext context, String ns)
-
Creates a reference that the key is generated automatically.
factory
Properties
- context → JsContext
-
The context this reference bound.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
The key of this reference.
final
- ns → String
-
The name of the space to storage actual value inside Js runtime.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → dynamic
-
Returns the value of this reference in the context.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJsCode(
{String? updater}) → String - Convert this reference to Javascript code. It is the code to update the value if the updater is specified, otherwise it is the code to retrieve the value.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
String updaterJs) → dynamic - Updates the value of this reference in the context.
-
updateAsync(
String updaterJs) → dynamic - Same as update but executes asynchronously.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited