Reference Source
public class | source

ClientRuntime

Extends:

../node_modules/devapt-core-common/dist/js/base/runtime_base.js~RuntimeBase → ClientRuntime

Constructor Summary

Public Constructor
public

constructor(): nothing

Create a client Runtime instance.

Member Summary

Public Members
public
public

classes: {}

public
public
public
Private Members
private
private
private

_router: *

private

_services: {}

private
private
private
private
private
private

_ui: *

Method Summary

Public Methods
public

command(arg_name: string): object

Get a command by its name.

public

Create a store change observer.

public

get_app_initial_state(arg_app_state_strategy: object): object

Get application initial state: from browser cache or from DOM script.

public

get_session_credentials(): Credentials

Get session credentials.

public

Get session id.

public

Get store reducers.

public

handle_store_change(): nothing

Handle Redux store changes.

public

init_app_state_save(): nothing

Configure application state save: to browser local or session storage.

public

load(arg_settings: object): nothing

Load runtime settings.

public

ping(): nothing

Emit a ping request through SocketIO.

public

register_service(arg_svc_name: string, arg_svc_settings: object): Promise

Register a remote service.

public

register_service_self(arg_svc_name: string, arg_svc_settings: object, arg_resolve_cb: Function, arg_reject_cb: Function): nothing

Register a remote service (end of process).

public

Get runtime router.

public

service(arg_name: string): Service

Get a service by its name.

public
public

ui(): *

Get UI.

public

Get UI rendering helper.

Public Constructors

public constructor(): nothing source

Create a client Runtime instance.

Return:

nothing

Public Members

public app_state_strategy: * source

public classes: {} source

public default_reducer: * source

public is_browser_runtime: boolean source

public logs_stream: * source

Private Members

private _commands: * source

private _commands_instances: {} source

private _router: * source

private _services: {} source

private _services_promises: {} source

private _session_credentials: * source

private _session_uid: * source

private _state_store: * source

private _state_store_unsubscribe: * source

private _ui: * source

Public Methods

public command(arg_name: string): object source

Get a command by its name.

Params:

NameTypeAttributeDescription
arg_name string

command name.

Return:

object

public create_store_observer(arg_component: Component): function source

Create a store change observer.

Params:

NameTypeAttributeDescription
arg_component Component

component instance.

Return:

function

store unsubscribe function.

public get_app_initial_state(arg_app_state_strategy: object): object source

Get application initial state: from browser cache or from DOM script. State strategy is { source:'browser' or 'session' or 'html', save_period: 5000, milliseconds between two state saves, 0 to disable save state_key: '...' name of the store key which corresponding value contains the key name of the application state. }

Params:

NameTypeAttributeDescription
arg_app_state_strategy object

strategy to manage application state.

Return:

object

public get_session_credentials(): Credentials source

Get session credentials.

Return:

Credentials

session credentials instance.

public get_session_uid(): string source

Get session id.

Return:

string

unique session id.

public get_store_reducers(): function source

Get store reducers.

!!! Do not trace with Loggable.* into reducers with an enabled StreamLogger instance because it dispatch its received trace to update app state.

Return:

function

reducer pure function: (previous state, action) => new state

public handle_store_change(): nothing source

Handle Redux store changes.

!! Do not trace with Loggable.* here.

Return:

nothing

public init_app_state_save(): nothing source

Configure application state save: to browser local or session storage. State strategy is { source:'browser' or 'session' or 'html', save_period: 5000, milliseconds between two state saves, 0 to disable save state_key: '...' name of the store key which corresponding value contains the key name of the application state. }

Return:

nothing

public load(arg_settings: object): nothing source

Load runtime settings.

Params:

NameTypeAttributeDescription
arg_settings object

runtime settings.

Return:

nothing

public ping(): nothing source

Emit a ping request through SocketIO.

Return:

nothing

public register_service(arg_svc_name: string, arg_svc_settings: object): Promise source

Register a remote service.

Params:

NameTypeAttributeDescription
arg_svc_name string

service name.

arg_svc_settings object

service settings.

Return:

Promise

Promise(Service)

public register_service_self(arg_svc_name: string, arg_svc_settings: object, arg_resolve_cb: Function, arg_reject_cb: Function): nothing source

Register a remote service (end of process).

Params:

NameTypeAttributeDescription
arg_svc_name string

service name.

arg_svc_settings object

service settings.

arg_resolve_cb Function

function to call when promise is resolved.

arg_reject_cb Function

function to call when promise is rejected.

Return:

nothing

public router(): Router source

Get runtime router.

Return:

Router

public service(arg_name: string): Service source

Get a service by its name.

Params:

NameTypeAttributeDescription
arg_name string

service name.

Return:

Service

public shoud_log_bindingd_stream(): boolean source

Return:

boolean

public ui(): * source

Get UI.

Return:

*

public ui_rendering(): * source

Get UI rendering helper.

Return:

*