sparkengineweb
    Preparing search index...

    Class SerializableCallback<T>

    Represents a serializable function, which can be serialized to a string and later deserialized back to a function.

    Type Parameters

    • T extends Function = Function
    Index

    Methods

    • Converts the SerializableCallback to a string representing its source code.

      Returns string

      the source code of the function as a string if serializable, otherwise 'function [not serializable]'

    • Type Parameters

      • T extends Function = Function

      Parameters

      • func: T

        the source function to create a SerializableCallback from

      • OptionalshouldSerialize: boolean

        whether the function should be serialized or not

      Returns SerializableCallback<T>

      a new SerializableCallback instance

    • Creates a new SerializableCallback instance from a function source code.

      Type Parameters

      • T extends Function = Function

      Parameters

      • source: string

        the source code of the function

      • OptionalshouldSerialize: boolean

        whether the function should be serialized or not

      Returns SerializableCallback<T>

      a new SerializableCallback instance