Skip to content

JSReference constructor (1 of 2)

Creates a new instance of a JSReference that holds a strong or weak reference to a JS value.

C#
public JSReference(JSValue value, bool isWeak = false)
parameterdescription
valueThe JavaScript value to reference.
isWeakTrue if the reference will be "weak", meaning the reference does not prevent the value from being released and collected by the JS garbage-collector. The default is false, meaning the value will remain available at least until the "strong" reference is disposed.

See Also


JSReference constructor (2 of 2)

Creates a new instance of a JSReference that holds a strong or weak reference to a JS value.

C#
public JSReference(napi_ref handle, bool isWeak = false)
parameterdescription
handleThe reference handle.
isWeakTrue if the handle is for a weak reference. This must match the existing state of the handle.

See Also

Released under the MIT license