The behavior of backbone-indexeddb varies in different environments as well: In an environment where exports exists, backbone-indexeddb will export a sync() function, otherwise it will mutate the Backbone object by adding a sync() function.
This suggests two improvements:
1) Enhance the UMD definition to support CJS-like environments (such as browserify), AMD and browser globals.
2) Always add a sync() function to Backbone regardless of the environment; and export and sync() function in CJS-like environments.
I'll submit a PR that implements these suggested changes soon. The PR will use a variation on this UMD pattern, which is similar to the method used in Backbone-layoutmanager
Dependencies and exports are currently managed in two places:
and
The behavior of backbone-indexeddb varies in different environments as well: In an environment where
exports
exists, backbone-indexeddb will export async()
function, otherwise it will mutate theBackbone
object by adding async()
function.This suggests two improvements:
1) Enhance the UMD definition to support CJS-like environments (such as browserify), AMD and browser globals.
2) Always add a
sync()
function toBackbone
regardless of the environment; and export andsync()
function in CJS-like environments.I'll submit a PR that implements these suggested changes soon. The PR will use a variation on this UMD pattern, which is similar to the method used in Backbone-layoutmanager