Skip to content

Commit

Permalink
Add a shared function demo to todoApp
Browse files Browse the repository at this point in the history
  • Loading branch information
sodic committed Nov 4, 2022
1 parent 997fe72 commit c0c2480
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions waspc/examples/todoApp/src/client/clientSetup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { sayHi } from '../shared/util'

export default function setup() {
console.log("This was called from the client setup function")
sayHi()
}
2 changes: 2 additions & 0 deletions waspc/examples/todoApp/src/server/serverSetup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { mySpecialJob } from '@wasp/jobs/mySpecialJob.js'
import { sayHi } from '../shared/util.js'

let someResource = undefined

export const getSomeResource = () => someResource

const setup = async () => {
sayHi()
await new Promise(resolve => setTimeout(resolve, 2000))
someResource = 'This resource is now set up.'
console.log('Custom server setup done!')
Expand Down

0 comments on commit c0c2480

Please sign in to comment.