Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createInitialBufferedDocument = snapshot => {
const bufferedDocument = new BufferedDocument(snapshot)
bufferedDocument.onMutation = ({mutation, remote}) => {
updates$.next({
type: 'mutation',
document: bufferedDocument.LOCAL,
mutations: mutation.mutations,
origin: remote ? 'remote' : 'local'
})
}
bufferedDocument.onRebase = edge => {
updates$.next({type: 'rebase', document: edge})
}
bufferedDocument.commitHandler = opts => {
const {resultRev, ...mutation} = opts.mutation.params
commits$.next({onSuccess: opts.success, onError: opts.failure, payload: mutation})
const createInitialBufferedDocument = snapshot => {
const bufferedDocument = new BufferedDocument(snapshot)
bufferedDocument.onMutation = ({mutation, remote}) => {
updates$.next({
type: 'mutation',
document: bufferedDocument.LOCAL,
mutations: mutation.mutations,
origin: remote ? 'remote' : 'local'
})
}
bufferedDocument.onRebase = edge => {
updates$.next({type: 'rebase', document: edge})
}
bufferedDocument.commitHandler = opts => {
const {resultRev, ...mutation} = opts.mutation.params
commits$.next({onSuccess: opts.success, onError: opts.failure, mutation})