Skip to content

Commit

Permalink
feat(bootstrap): allow a thunk instead of a bootstrap object
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 14, 2019
1 parent c7f222f commit d4582fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# `@agoric/mini-captp`
# `@agoric/captp`

A miniature CapTP implementation leveraging Agoric's published modules.
A minimal CapTP implementation leveraging Agoric's published modules.

## Usage

```
import makeCapTP from '@agoric/mini-captp';
import makeCapTP from '@agoric/captp';
import { E } from '@agoric/eventual-send';
// Create a message handler and bootstrap.
Expand Down
5 changes: 4 additions & 1 deletion lib/captp.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,13 @@ export default function makeCapTP(ourId, send, bootstrapObj = undefined) {
const handler = {
CTP_BOOTSTRAP(obj) {
const { questionID } = obj;
const bootstrap =
typeof bootstrapObj === 'function' ? bootstrapObj() : bootstrapObj;
// console.log('sending bootstrap', bootstrap);
send({
type: 'CTP_RETURN',
answerID: questionID,
result: serialize(bootstrapObj),
result: serialize(bootstrap),
});
},
CTP_CALL(obj) {
Expand Down

0 comments on commit d4582fc

Please sign in to comment.