mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-12 13:35:32 +00:00
Add example how to import aqua function
This commit is contained in:
parent
9195d58c08
commit
9c4d6b350f
17
README.md
17
README.md
@ -71,11 +71,11 @@ it might be a good idea to add these scripts to your `package.json` file
|
||||
For example you project structure could look like this:
|
||||
|
||||
```
|
||||
┣ aqua
|
||||
┃ ┗ hello-world.aqua
|
||||
┣ _aqua
|
||||
┃ ┗ demo.aqua
|
||||
┣ src
|
||||
┃ ┣ _aqua
|
||||
┃ ┃ ┗ hello-world.ts
|
||||
┃ ┃ ┗ demo.ts
|
||||
┃ ┗ index.ts
|
||||
┣ package-lock.json
|
||||
┣ package.json
|
||||
@ -96,6 +96,17 @@ And your package json:
|
||||
}
|
||||
```
|
||||
|
||||
6. Now you can import and use call aqua code from your application. e.g;
|
||||
|
||||
```
|
||||
import { getRelayTime } from "./_aqua/demo";
|
||||
|
||||
async function buttonClick() {
|
||||
const time = await getRelayTime();
|
||||
alert("relay time: " + time);
|
||||
}
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
To hack on the JS Client itself refer to [dev page](./DEVLOPING.md).
|
||||
|
Loading…
Reference in New Issue
Block a user