base
The first behavior added to every can-connect
connection. Provides methods to uniquely identify instances and
lists.
base(connectionOptions)
Provides instance and list identifiers. Added automatically to every connection created by the connect
helper.
So even if we do:
var connection = connect([],{});
The connection still has the identification functionality provided by base
:
connection.id({id: 1, ...}) //-> 1
can-connect
connections are typically created by the connect
helper rather than by calling the behaviors directly.
This ensures the behaviors are called in the required order and is more elegant than requiring the user to chain
together the calls to all the behaviors.
See the id and listSet methods for more specifics on how ids are determined.
Parameters
- connectionOptions
{Object}
:Object containing the configuration for the behaviors of the connection. Added to the prototype of the returned connection object.
base
is almost always configured with an algebra option since it defines the id property and the majority of behaviors also require the algebra.
Returns
{Object}
:
A can-connect
connection containing the methods provided by base
.