⁘ common.helpers

BindingKit

A binding kit is a simple helper class that handle boilerplate code for class registration & global bindings.

_Init(){ super._Init();

    this.AddClasses(
        Metadata,
        DataBlock
    );

    this.Add(
    {
        context:SERIALIZATION_CONTEXT.SERIALIZER,
        kvps:[
             { key:SERIALIZATION_CONTEXT.JSON, binding:JSONSerializer },
             { key:SERIALIZATION_CONTEXT.TEXT, binding:TEXTSerializer }
         ]
    },
    {
        context:SERIALIZATION_CONTEXT.JSON,
        kvps:[
            { key:Metadata, binding:MetadataJSONSerializer },
            { key:DataBlock, binding:DataBlockJSONSerializer }
        ]
    });

 }
go to → Members

Extends

Broadcasting

This section list the main methods used to watch/unwatch signals on this object. For more info on signals, see signals

Methods

Unwatch(p_signal, p_fn, p_listener) → {common.pool.DisposableObjectEx}

Inherited From:

Watch(p_signal, p_fn, p_listener) → {common.pool.DisposableObjectEx}

Inherited From:

WatchOnce(p_signalId, p_fn, p_listener) → {common.pool.DisposableObjectEx}

Inherited From:

protected_Broadcast(p_signal, …args)

Inherited From:
Initialization

Methods

protectedoverride-me_Init()

Inherited From:

protectedoverride-me_PostInit()

Inherited From:
Utils

Methods

protected_Bind(p_func)

Inherited From:
Pooling

Group of methods related to the NKMjs pooling system.

Members

read-onlyisReleasing :boolean

Inherited From:

Methods

Release()

Inherited From:

protectedoverride-me_CleanUp()

Inherited From:
Misc

Methods

Add(…args)

Add any number of bindings to this kit.

Parameters:
Name Type Attributes Description
args BindingDefinition <repeatable>
Examples:
this.Add(
    { context:Kitchen, kvps:[ { key:Ustensil, binding:Fork } ] },
    { context:DefaultEditor, kvps:[ { key:FooData, binding:FooDataEditor } ] },
    { context:DefaultInspector, kvps:[ { key:Bar, binding:BarInspector } ] }
);

AddClasses(…args)

Add any number of classes to this kit.
Identifier will be fetched from the class' NFO uid when the BindingKit is deployed. If no NFO is found for a given class, an error will be thrown.

Parameters:
Name Type Attributes Description
args constructor <repeatable>
Examples:
this.AddClasses(Foo, Bar);

Conceal()

Un-register this kit's data & associations from common.BINDINGS

Deploy()

Register this kit's data & associations to common.BINDINGS

PreventRelease()

Inherited From: