This repository was archived by the owner on Nov 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ To use the component just add this to the `dependencies` field of the projects
8
8
```
9
9
"mint-codemirror": {
10
10
"repository": "https://github.com/mint-lang/mint-codemirror",
11
- "constraint": "3 .0.0 <= v < 4 .0.0"
11
+ "constraint": "5 .0.0 <= v < 6 .0.0"
12
12
}
13
13
```
14
14
@@ -17,7 +17,7 @@ To get the basic component without any modes and the default theme, just add the
17
17
18
18
```
19
19
component Main {
20
- fun onChange (value : String) : Promise(Never, Void ) {
20
+ fun onChange (value : String) : Promise(Never, String ) {
21
21
sequence {
22
22
Debug.log(value)
23
23
}
@@ -136,17 +136,11 @@ The following properties are available:
136
136
This is an example for using the all of the properties:
137
137
138
138
```
139
- record Main.State {
140
- value : String
141
- }
142
-
143
139
component Main {
144
- state : Main.State {
145
- value = "def print\n puts 'Hello World!'\nend"
146
- }
140
+ state value : String = "def print\n puts 'Hello World!'\nend"
147
141
148
142
fun onChange (value : String) : Promise(Never, Void) {
149
- next { state | value = value }
143
+ next { value = value }
150
144
}
151
145
152
146
fun render : Html {
@@ -157,13 +151,12 @@ component Main {
157
151
]
158
152
styles=[
159
153
"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.css",
160
- "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/theme/dracula.min.css",
154
+ "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/theme/dracula.min.css"
161
155
]
162
156
onChange={onChange}
163
- value={state. value}
157
+ value={value}
164
158
theme="dracula"
165
- mode="ruby"
166
- />
159
+ mode="ruby"/>
167
160
}
168
161
}
169
162
```
You can’t perform that action at this time.
0 commit comments