transport agnostic strongly typed duplex rpc interfaces
# Alice
– Alice class.
src/alice-bob.ts#L292
# local
– The local Agent.
src/alice-bob.ts#L95 {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
}
# agents
(local, remote) – Returns the agents tuple [alice, bob]
.
src/alice-bob.ts#L276
Example:
const [alice, bob] = new Alice<Local, Remote>().agents()
// to enable debugging on local (alice)
const [alice, bob] = new Alice<Local, Remote>().agents({ debug: true })
// use different names:
const [alice, bob] = new Alice<Local, Remote>().agents(
{ name: 'server', debug: true },
{ name: 'client' }
)
agents(local, remote) =>
- [ {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
}, Agent<B, A> ]
# AliceBob
– AliceBob class.
src/alice-bob.ts#L82
# local
– The local Agent.
src/alice-bob.ts#L95 {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
}
# agents
(local, remote) – Returns the agents tuple [alice, bob]
.
src/alice-bob.ts#L276
Example:
const [alice, bob] = new Alice<Local, Remote>().agents()
// to enable debugging on local (alice)
const [alice, bob] = new Alice<Local, Remote>().agents({ debug: true })
// use different names:
const [alice, bob] = new Alice<Local, Remote>().agents(
{ name: 'server', debug: true },
{ name: 'client' }
)
agents(local, remote) =>
- [ {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
}, Agent<B, A> ]
# Bob
– Bob class.
src/alice-bob.ts#L313
# local
– The local Agent.
src/alice-bob.ts#L95 {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
}
# agents
(local, remote) – Returns the agents tuple [alice, bob]
.
src/alice-bob.ts#L276
Example:
const [alice, bob] = new Alice<Local, Remote>().agents()
// to enable debugging on local (alice)
const [alice, bob] = new Alice<Local, Remote>().agents({ debug: true })
// use different names:
const [alice, bob] = new Alice<Local, Remote>().agents(
{ name: 'server', debug: true },
{ name: 'client' }
)
agents(local, remote) =>
- [ {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
}, Agent<B, A> ]
# Agent
– Agent.
src/alice-bob.ts#L28 {
# name
– The name of the agent. Defaults to either 'alice' or 'bob' depending
on the constructor used, Alice or Bob.
src/alice-bob.ts#L38 string
# send
– The send method overriden by the user to any transport.
src/alice-bob.ts#L43 PayloadMethod<Agent<B, A>>
# deferredSend
() – Returns the send method. Used in contexts where it might
change between sessions, like browser refresh/hot/livereload.
src/alice-bob.ts#L49
deferredSend() =>
- PayloadMethod<Agent<B, A>>
# log
(args) – Overridable logging function. Defaults to console.log()
and prepends agent.name
.
src/alice-bob.ts#L63
# args
unknown []
log(args) =>
- void
All contributions are welcome!