How to use the svelte-native/dom.logger.warn function in svelte-native

To help you get started, we’ve selected a few svelte-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github halfnelson / svelte-native-nativescript-ui / src / listview / index.ts View on Github external
private updateListItem(args: ListViewEventData) {
        let item;
        let listView = this.nativeView;
        let items = listView.items;

        if (args.index >= items.length) {
            logger.warn("Got request for item at index that didn't exist");
            return;
        }

        //groups have index less than zero
        if (args.index < 0) {
            this.updateViewWithProps(args.view, { item: args.view.bindingContext.category } );
            return;
        }

        if (items.getItem) {
            item = items.getItem(args.index);
        } else {
            item = items[args.index]
        }

        this.updateViewWithProps(args.view, { item });