When a share gets created, a $share doc gets stored and synched to the user's database. From there the $share worker handles the rest:
The worker updates the $share doc status, which gets synched back to the frontend. When the user deletes the $share doc, the worker removes the database, the user and all replications
// returns a share instance
// with share.id set to 'share_id'
hoodie.share('share_id')
// the rest of the API is a standard store API, with the
// difference that no type has to be set and the returned
// promises are resolved with share instances instead of
// simple objects
hoodie.share.add(attributes)
hoodie.share.find('share_id')
hoodie.share.findAll()
hoodie.share.findOrAdd(id, attributes)
hoodie.share.save(id, attributes)
hoodie.share.update(id, changed_attributes)
hoodie.share.updateAll(changed_attributes)
hoodie.share.remove(id)
hoodie.share.removeAll()
the constructor returns a function, so it can be called like this: hoodie.share('share_id')
The rest of the API is available as usual.
set pointer to Hoodie.ShareInstance
return custom api which allows direct call
creates a new share and returns it
find an existing share
find all my existing shares
find or add a new share
add or overwrite a share
add or overwrite a share
update all my existing shares
deletes an existing share
delete all existing shares
opens a a remote share store, returns a Hoodie.Remote instance
hoodie.store decorations add custom methods to promises returned by hoodie.store methods like find, add or update. All methods return methods again that will be executed in the scope of the promise, but with access to the current hoodie instance
extend Hoodie
Share Module