Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 740c9ef

Browse files
committed
Update Readme.md.
1 parent dcb359f commit 740c9ef

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To use the component just add this to the `dependencies` field of the projects
88
```
99
"mint-codemirror": {
1010
"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"
1212
}
1313
```
1414

@@ -17,7 +17,7 @@ To get the basic component without any modes and the default theme, just add the
1717

1818
```
1919
component Main {
20-
fun onChange (value : String) : Promise(Never, Void) {
20+
fun onChange (value : String) : Promise(Never, String) {
2121
sequence {
2222
Debug.log(value)
2323
}
@@ -136,17 +136,11 @@ The following properties are available:
136136
This is an example for using the all of the properties:
137137

138138
```
139-
record Main.State {
140-
value : String
141-
}
142-
143139
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"
147141
148142
fun onChange (value : String) : Promise(Never, Void) {
149-
next { state | value = value }
143+
next { value = value }
150144
}
151145
152146
fun render : Html {
@@ -157,13 +151,12 @@ component Main {
157151
]
158152
styles=[
159153
"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"
161155
]
162156
onChange={onChange}
163-
value={state.value}
157+
value={value}
164158
theme="dracula"
165-
mode="ruby"
166-
/>
159+
mode="ruby"/>
167160
}
168161
}
169162
```

0 commit comments

Comments
 (0)