Entrypoint<I> constructor
Entrypoint<I> (
- WorkerEntrypoint<
I> entry, { - PayloadCallback? onInit,
- Object? initData,
A wrapper that creates two way communication possible.
The entry function must be a top-level function or a static method that can be called with a single argument, that is, a compile-time constant function value which accepts at least one positional parameter and has at most one required positional parameter. The function may accept any number of optional parameters, as long as it can be called with just a single argument. The function must not be the value of a function expression or an instance method tear-off.
I
: Input Type
Implementation
Entrypoint(this.entry, {this.onInit, this.initData}) {
assert(
(initData != null && onInit != null) || initData == null,
"InitData only allowed when onInit is defined.",
);
}