backbone-publication
backbone-publication
implements the boilerplate code that is required to make
backbone
and our publication based system (through
publication-client
)
play nicely together. To use these classes, you simply need to instantiate them
with the necessary reactive queries from a publication-client
. This normally
can be done in the bootstrapping process. For instance:
// During the bootstrapping process we normally initialize most// collections/models - using `backbone-publication` collections/models is no// different. var featureCollection = initialPayloadfeatures // pubClient is initialized by using the `publication-client` constructor. reactiveQuery: pubClient waitOn: pubClient);
Where FeatureCollection is defined as:
; // Note that we only need to extend the Publication[Collection,Model]s if we// need to add custom behavioural overrides.var FeatureCollection = PublicationCollection; ;