automerge/rust/automerge-wasm/examples/cra
Alex Good dd3c6d1303
Move rust workspace into ./rust
After some discussion with PVH I realise that the repo structure in the
last reorg was very rust-centric. In an attempt to put each language on
a level footing move the rust code and project files into ./rust
2022-10-16 19:55:51 +01:00
..
public Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
src Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
.gitignore Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
package.json Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
README.md Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
tsconfig.json Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00

Example CRA App using AutomergeWASM

Creating this example app

   $ cd automerge-wasm && yarn pkg # this builds the npm package
   $ cd ../examples
   $ npx create-react-app cra --template typescript
   $ cd cra
   $ npm install ../../automerge-wasm/automerge-wasm-v0.1.0.tgz

Then I just needed to add the import "automerge-wasm" and { useEffect, useState } code to ./src/App.tsx

    $ npm start

Open Issues

The example app currently doesn't do anything useful. Perhaps someone with some react experience and figure out the right way to wire everything up for an actual demo.