ViewChannelViewConfig<T, R>

TYPE DEFINITION

Holds the configuration of a view which is placed in the ViewChannel. From this configuration the actual ViewChannelView is created.

Since 1.0.0

Properties

  • autoDismiss Optional

    ViewChannelViewAutoDismissConfig<R>

    Whether or not autoDismiss is enabled. When autoDismiss is enabled it will dismiss the view, based on the duration.

    Defaults to no autoDismiss, meaning it will stay visible forever, until it is dismissed.

    Since 1.0.0

  • data

    T

    The data for the presented view, "data" can be be anything from an object, string, array etc etc. It is used to pass along data to the view you might need to display the view, such as the text for a flash message or confirmation dialog.

    By default the value is undefined.

    Since 1.0.0

  • priority Optional

    number | number []

    The priority the ViewChannelView will have within the ViewChannel. The lower the priority the closer it will be to the start of the ViewChannel views array.

    A priority is expressed as an array of numbers, each index in the array represents a "level" in the priority, the earlier levels (the lower indexes) have higher priority over the later levels (the higher indexes).

    If two priorities are compared, first the level at index zero is compared, if they are the same the index at the second level is compared, if the second level is also the same the third level is compared, and so on and so on until there are no more levels.

    A couple examples:

    1. [0, 0, 0] has a higher priority than [1, 0, 0]
    2. [1, 0, 0] has a higher priority than [2, 0, 0]
    3. [0, 0, 0] has a higher priority than [0, 1, 0]
    4. [0, 1, 0] has a higher priority than [0, 2, 0]
    5. [0, 0, 0] has a higher priority than [0, 0, 1]
    6. [0, 0, 1] has a higher priority than [0, 0, 2]
    7. [0, 0, 1] has a higher priority than [1, 0, 0]

    If the priority arrays when compared differ in size, the missing items are considered zeros. So for example:

    1. [0] has a higher priority than [1, 0, 0]
    2. [0, 0] has a higher priority than [0, 1, 1]

    If two priorities match exactly the view is placed after the existing view with the same priority. This means that the order will be the order of insertion.

    Note: you can provide a number instead of an array instead, in this case an array is created with the provided number as the first value in the array. So providing 5 will be treated as [5].

    Defaults to [0] when no priority is given, this makes it the highest priority.

    Since 1.0.0