gets options passed to Gun( { wsc: { ...} } ) and puts wsc options in wsp which is used to contain a working state 'count' right now. In addition to 'count' it will now contain 'wsc' which are the options passed to the gun instance. This is cached on the 'cat' so the lookup should only be one time.
Since 'cat' becomes 'peer' later, peer.wsp.wsc are the new options. These will always exist for the WebSocket call. They default to 'null' and or Empty so no change will be expected without additional options.
Previously constructor options were deeply copied, which caused
issues with 3rd party plugins when they pass "class" instances as
options (since instances were copied into POJOs, breaking the prototype
chain). Now it's shallow copied. Special treatment is still given for
the `peers` property.
Previously, the client websocket layer would only attempt a reconnection
if there were pending messages in the queue. Now it will always attempt
a reconnection, solving most of issue #259 (although not completely, as
reconnects are susceptible to race conditions).
The Client constructor supports backoff configuration. This commit
exposes it to the end developer via the `peers` options object, in the
`backoff` property.
Example:
Gun({
peers: {
'url.com/gun': {
backoff: { max: 1000, factor: 0.2 }
}
}
})
Two separate modules (localStorage & websockets) ensured JSON was
globally defined. Since only one is needed to alert the user, the
other has been removed.