Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 4bd4446

Browse files
committed
Async 'served' event
1 parent a54b012 commit 4bd4446

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fiori/server.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
const cds = require ('@sap/cds')
22

3+
cds.emit = function (event,...args) {
4+
switch (event) {
5+
case 'served': return this.served = Promise.all (this.listeners(event).map (each => each.call(this,...args)))
6+
case 'listening': return this.served.then (()=> this.__proto__.emit.call (this, event, ...args))
7+
default: return this.__proto__.emit.call (this, event, ...args)
8+
}
9+
}
10+
311
cds.once('bootstrap',(app)=>{
412
app.use ('/orders/webapp', _from('@capire/orders/app/orders/webapp/manifest.json'))
513
app.use ('/bookshop', _from('@capire/bookshop/app/vue/index.html'))

0 commit comments

Comments
 (0)