Type alias Config<Cmp, EventMap, Required>

Config<Cmp, EventMap, Required>: Writeable<Partial<ExcludeFunctionPropertyNames<Omit<Cmp, Required>>>> & Writeable<Pick<Cmp, Required>> & {
    listeners?: ObservableListener<EventMap>;
}

Generic Config option that allows all public properties as options. It excludes all function types. If you need to pass functions as config options you will need to add them like this:

type ChipsConfig = Config<ChipsField, FieldEventMap<ChipsField>> &
// Add the function properties as they are filtered out
Partial<Pick<ChipsField, "textInputToValue" | "chipRenderer">>

Type Parameters

Type declaration

  • Optional listeners?: ObservableListener<EventMap>

    Add listeners

    You can pass them in two ways:

    Example

    comp({
    listeners: {

    //simple syntax add the listener directly
    additem:(container, item, index) => {
    //do something when an item was added
    },

    // extended syntax to pass extra listener options
    beforeadditem: {
    //with this syntax you can pass extra options
    fn:(container, item, index) => {
    //do something before an item will be added but only once
    },
    once: true
    }
    }
    })
    ```

    See

    Observable.on()

Generated using TypeDoc