Protocol
JSClosureProtocol
public protocol JSClosureProtocol: JSValueCompatible
JSClosureProtocol
wraps Swift closure objects for use in JavaScript. Conforming types
are responsible for managing the lifetime of the closure they wrap, but can delegate that
task to the user by requiring an explicit release()
call.
Relationships
Conforms To
JSValueCompatible
Types Conforming to JSClosureProtocol
JSOneshotClosure
JSOneshotClosure
is a JavaScript function that can be called only once. This class can be used for optimized memory management when compared to the commonJSClosure
.JSClosure
JSClosure
represents a JavaScript function the body of which is written in Swift. This type can be passed as a callback handler to JavaScript functions.
Requirements
release()
func release()
Release this function resource.
After calling release
, calling this function from JavaScript will fail.