automerge/automerge-js
Alex Good dbf438f7cb
Track whether a transaction is observed in types
With the `OpObserver` moving to the transaction rather than being passed
in to the `Transaction::commit` method we have needed to add a way to
get the observer back out of the transaction (via
`Transaction::observer` and `AutoCommit::observer`). This `Observer`
type is then used to handle patch generation logic. However, there are
cases where we might not want an `OpObserver` and in these cases we can
execute various things fast - so we need to have something like an
`Option<OpObserver>`. In order to track the presence or otherwise of the
observer at the type level introduce
`automerge::transaction::observation`, which is a type level `Option`.
This allows us to efficiently choose the right code paths whilst
maintaining correct types for `Transaction::observer` and
`AutoCommit::observer`
2022-10-06 22:38:37 +01:00
..
config some api changes/tweaks - basic js package 2022-05-31 13:49:18 -04:00
e2e Track whether a transaction is observed in types 2022-10-06 22:38:37 +01:00
examples Add examples of using automerge with bundlers 2022-10-04 17:23:37 +01:00
src this crept back in somehow... the child of a document is not a document 2022-10-04 16:01:57 -07:00
test move automerge-js onto the applyPatches model 2022-10-04 18:17:03 +01:00
.eslintignore tslint to eslint 2022-05-22 13:53:11 -04:00
.eslintrc.cjs tslint to eslint 2022-05-22 13:53:11 -04:00
.gitignore fix some typescript errors - depricate default export of the wasm package 2022-08-11 18:24:21 -05:00
LICENSE able to build npm package 2022-05-22 13:53:11 -04:00
package.json move automerge-js onto the applyPatches model 2022-10-04 18:17:03 +01:00
README.md Update JS README 2022-10-04 17:23:37 +01:00
tsconfig.json Generate index.d.ts from source 2022-10-04 17:23:37 +01:00
tslint.json convert automerge-js to typescript 2022-05-22 13:53:11 -04:00

Automerge

Automerge is a library of data structures for building collaborative applications, this package is the javascript implementation.

Please see automerge.org for documentation.

Setup

This package is a wrapper around a core library which is written in rust and compiled to WASM. In node this should be transparent to you, but in the browser you will need a bundler to include the WASM blob as part of your module hierarchy. There are examples of doing this with common bundlers in ./examples.

Meta

Copyright 20172021, the Automerge contributors. Released under the terms of the MIT license (see LICENSE).