-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The default value is now null. It could be handy if especially for methods that return an array to have the init value be an empty array.
Just don't want to create an config object just for that little functionality, like:
fetchBooks: {
defaultValue: [],
handler() {
return api.fetchBooks()
}
}
I think it would be better to do something convention based, like the computed name convention. Maybe:
fetchBooksList() {
return api.fetchBooks()
}
and a default function that interprets that like:
function getDefaultValue(vm, methodName) {
var useArray = /List$/.test(methodName)
return useArray ? [] : null
}
And make that function replaceable.
Metadata
Metadata
Assignees
Labels
No labels