Skip to content

Commit 2bc0388

Browse files
committed
Fix WIT snippets in README
1 parent 320c7ad commit 2bc0388

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ using Golem app templates.
9696
The following WIT code:
9797

9898
```wit
99-
package demo: package;
99+
package demo:pkg;
100100
101-
world example {
102-
export hello: func() -> string;
103-
}
101+
world example {
102+
export hello: func() -> string;
103+
}
104104
```
105105

106106
must be implemented in JavaScript as:
@@ -120,15 +120,15 @@ Exported interfaces has to be exported from JavaScript as objects:
120120
The following WIT example:
121121

122122
```wit
123-
package demo: package;
123+
package demo:pkg;
124124
125-
interface sample-api {
126-
get-string-length: func(value: string) -> u64;
127-
}
125+
interface sample-api {
126+
get-string-length: func(value: string) -> u64;
127+
}
128128
129129
world example {
130-
export sample-api;
131-
}
130+
export sample-api;
131+
}
132132
```
133133

134134
has to be implemented in JavaScript as:
@@ -151,20 +151,20 @@ Exported resources are implemented as **classes** in JS:
151151
The following WIT example:
152152

153153
```wit
154-
package demo: package;
155-
156-
interface iface {
157-
resource example-resource {
158-
constructor(name: string);
159-
get-name: func() -> string;
160-
compare: static func(h1: borrow<example-resource>, h2: borrow<example-resource>) -> s32;
161-
merge: static func(h1: own<example-resource>, h2: own<example-resource>) -> hello;
162-
}
163-
}
154+
package demo:pkg;
155+
156+
interface iface {
157+
resource example-resource {
158+
constructor(name: string);
159+
get-name: func() -> string;
160+
compare: static func(h1: borrow<example-resource>, h2: borrow<example-resource>) -> s32;
161+
merge: static func(h1: own<example-resource>, h2: own<example-resource>) -> hello;
162+
}
163+
}
164164
165165
world example {
166-
export iface;
167-
}
166+
export iface;
167+
}
168168
```
169169

170170
Must be exported from JavaScript in the following way:

0 commit comments

Comments
 (0)