aurelia / documentation

The documentation for Aurelia.
MIT License
105 stars 111 forks source link

Why is Reflect.ownKeys used instead of Object.keys in Templating Basics / Repeaters / Objects? #361

Closed petmat closed 6 years ago

petmat commented 6 years ago

http://aurelia.io/docs/templating/basics#repeaters

In the Objects section, there is a sample code of a KeysValueConverter class and in the toView method the Reflect.ownKeys function is used instead of the Object.keys function. We have run into issues where the keys include more than the keys we would like to iterate over and that might be because the Reflect.ownKeys returns more than just the iterable property keys. Why would the example code not use Object.keys which is more appropriate and even has a better browser support?

Alexander-Taran commented 6 years ago

Would you like to come up with a pull reuquest to the docs adding your variant of KeysValueConverter and explaining the difference? It is this file you need https://github.com/aurelia/templating/blob/master/doc/article/en-US/templating-basics.md

Alexander-Taran commented 6 years ago
async triageQuestion(id) =>{

 respondSomeDay()
 let response = await getResponseFromOP( { timeout : 2weeks } )
 if(!response) {
    closeQuestion(id,randomReason())
 }
}