Skip to content

Commit

Permalink
feat: bootstrap now creates a context
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Aug 19, 2019
1 parent ed3df96 commit 517eaa7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/@nodepack/app/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const { callHook } = require('@nodepack/app-context')
const { createContext, callHook } = require('@nodepack/app-context')

/**
* @param {function} callback
* @param {(ctx: any) => Promise<any>} callback
*/
exports.bootstrap = async (callback) => {
await callHook('bootstrap')
await callback()
const ctx = await createContext()
await callHook('bootstrap', ctx)
await callback(ctx)
return ctx
}

0 comments on commit 517eaa7

Please sign in to comment.