docs
docs copied to clipboard
add impl() noop wrapper to simple sample
The sample given had a const cds = require('@sap/cds')
but didn't use the cds
after that. Moreover, the constant was then highlighted in VS Code as unused, with a rather urgent red squiggly line, which no-one wants :-)
I suggest that rather than omit this line, perhaps it's better to leave it in and use it to provide the noop wrapper that enables Intellisense.
Thanks for the hint @qmacro.
Looks like a nice way out of the 'unused var' issue. The thing that bothers me is that our docs refer to cds.service.impl
as 'old-style'. So I wonder if should rather use the class
pattern (cds.ApplicationService
) although that's a bit harder to grasp for beginners.
@qmacro @sjvans opinions?
i lean towards removing cds
rather than showing the old style or the more complex class approach. the import is not really needed as we add global.cds
anyways. and if your liniting rules don't consider that, then you can add it once you need it in your impl.