Reference Source
public class | source

RouterState

Extends:

../node_modules/devapt-core-common/dist/js/base/stateable.js~Stateable → RouterState

Direct Subclass:

Router

Constructor Summary

Public Constructor
public abstract

constructor(arg_log_context: string): nothing

Create a RouterState instance.

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

display_content(arg_view_name: string, arg_menubar_name: string): Promise

Display the page content with given view and menubar.

public

Clear history.

public

do_action_display_content(arg_view_name: string, arg_menubar_name: string): nothing

Goto the page content with given view (update only the hash).

public

Display history previous content if available.

public

Display history next content if available.

public

do_action_move_history(arg_new_index: *): nothing

Move history current position.

public

do_action_update_history(arg_new_items: array): nothing

Update history.

public

Get name.

public

handle_state_change(arg_previous_state: Immutable.Map, arg_new_state: Immutable.Map): nothing

Handle state changes.

public

load(arg_state: Immutable.Map | undefined): nothing

Load and apply a container component configuration.

public

reduce_action(arg_previous_state: object, arg_action: object): object

Store actions reducer pure function.

public

update_hash(arg_view_name: string, arg_menubar_name: string): nothing

Update page url with given view and menubar (update only the hash).

Public Constructors

public abstract constructor(arg_log_context: string): nothing source

Create a RouterState instance.

Params:

NameTypeAttributeDescription
arg_log_context string

context of traces of this instance (optional).

Return:

nothing

Public Members

public is_router_state: boolean source

public state_path: string[] source

Public Methods

public display_content(arg_view_name: string, arg_menubar_name: string): Promise source

Display the page content with given view and menubar.

Params:

NameTypeAttributeDescription
arg_view_name string

view name

arg_menubar_name string

menubar name

Return:

Promise

Resolved result is a boolean: success or failure

public do_action_clear_history(): nothing source

Clear history.

Return:

nothing

public do_action_display_content(arg_view_name: string, arg_menubar_name: string): nothing source

Goto the page content with given view (update only the hash).

Params:

NameTypeAttributeDescription
arg_view_name string

view name.

arg_menubar_name string

menubar name.

Return:

nothing

public do_action_go_backward(): nothing source

Display history previous content if available.

Return:

nothing

public do_action_go_forward(): nothing source

Display history next content if available.

Return:

nothing

public do_action_move_history(arg_new_index: *): nothing source

Move history current position.

@param{Number} arg_new_index - history position index.

Params:

NameTypeAttributeDescription
arg_new_index *

Return:

nothing

public do_action_update_history(arg_new_items: array): nothing source

Update history.

Params:

NameTypeAttributeDescription
arg_new_items array

history array items.

Return:

nothing

public get_name(): string source

Get name.

Return:

string

public handle_state_change(arg_previous_state: Immutable.Map, arg_new_state: Immutable.Map): nothing source

Handle state changes.

Params:

NameTypeAttributeDescription
arg_previous_state Immutable.Map

previous state map.

arg_new_state Immutable.Map

new state map.

Return:

nothing

public load(arg_state: Immutable.Map | undefined): nothing source

Load and apply a container component configuration.

Params:

NameTypeAttributeDescription
arg_state Immutable.Map | undefined

component state to load (optional).

Return:

nothing

public reduce_action(arg_previous_state: object, arg_action: object): object source

Store actions reducer pure function.

Params:

NameTypeAttributeDescription
arg_previous_state object

previous state.

arg_action object

store action: { type:'', component:'', ...}

Return:

object

new state

public update_hash(arg_view_name: string, arg_menubar_name: string): nothing source

Update page url with given view and menubar (update only the hash).

Params:

NameTypeAttributeDescription
arg_view_name string

view name.

arg_menubar_name string

menubar name.

Return:

nothing