dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

dojo/widget-core typo in code snippet #397

Closed sombrerox closed 6 years ago

sombrerox commented 6 years ago

There is a minor typo in one of the code snippets in dojo/widget-core/documentation, there is a following code snippet there:

`interface ListProperties { items: { id: string; content: string; highlighted: boolean; }; }

class List extends WidgetBase { protected render() { const { items } = this.properties;

    return v('ul', { classes: 'list' }, items.map((item) => {
        const { id, highlighted, content } = item;
        const classes = [ highlighted ? 'highlighted' : null ];

        return v('li', { key: id, classes }, [ content ]);
    });
}

}`

map() is being used on an object, I believe author wanted to define items property as an array of

{ id: string; content: string; highlighted: boolean; }

like:

{ id: string; content: string; highlighted: boolean; }[]

rather than a single instance.

This is my first time posting so forgive me for bad formatting, I'm having some problems with code tag. I have seen more minor mistakes in code elsewhere in documentation, I'll make sure to post back when/if I stumble upon them.

agubler commented 6 years ago

Issue moved to dojo/widget-core #957 via ZenHub