You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: v0.3/tutorials/quickstart.eve
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ This guide is a 5 - 10 minute introduction to the essential concepts in Eve. If
11
11
npm start -- eve-starter/programs/quickstart.eve
12
12
```
13
13
14
-
Eve documents are written in Markdown. Eve code is written in blocks, delinated by Markdown code fences (matching pairs of ``` or ~~~ surrounding a section of code). These blocks of code search for and create records, which are key value pairs attached to a unique ID.
14
+
Eve documents are written in Markdown. Eve code is written in blocks, delineated by Markdown code fences (matching pairs of ``` or ~~~ surrounding a section of code). These blocks of code search for and create records, which are key value pairs attached to a unique ID.
15
15
16
16
## Adding records to Eve
17
17
@@ -38,13 +38,20 @@ bind
38
38
[#ui/text text: message]
39
39
~~~
40
40
41
-
Searches find records that matches the supplied pattern, in this case records tagged greeting with a message attribute. You use these results to create new records. In this block, we create a `#ui/text` record for every message that is found. If no records match the search, the block has no effect. Try adding another `#greeting` record in the first block to see what happens when more than one record matches the search.
41
+
Searches find records that matches the supplied pattern, in this case records tagged greeting with a message attribute. You use these results to create new records. In this block, we create a `#ui/text` record for every message that is found (the UI library looks for records tagged `#ui/text` and draws them as DOM elements in the browser). If no records match the search, the block has no effect. Try adding another `#greeting` record in the first block to see what happens when more than one record matches the search.
42
42
43
43
Variables with the same name are equivalent within a block; because they have the same name, the `message` in `[#greeting message]` and `[#ui/text text: message]` are equivalent.
44
44
45
45
## Records update as data changes
46
46
47
-
Blocks in Eve react automatically to changes in data. When a record changes, any bound records are automatically updated. Let's search for the current time, and display it on the screen:
47
+
Blocks in Eve react automatically to changes in data. When a record changes, any bound records are automatically updated. We can see this in action by outputting the current time. First we create a timer that ticks once every second:
48
+
49
+
~~~eve
50
+
commit
51
+
[#time #system/timer resolution: 1000]
52
+
~~~
53
+
54
+
Now we can search for the current time, and display it on the screen:
48
55
49
56
~~~eve
50
57
search
@@ -77,7 +84,7 @@ commit
77
84
78
85
Clicks only last for an instant, but we want to create a permanent record of each click so we can search for them later. This block commits a `#clicked` record that will persist until it's explicitly removed. Much like the `#greeting` text we bound to the `#ui`, variables with the same name are equivalent, so the variable `event` in the `#clicked` record is a reference to the `#html/event/click` on the `#increment` button.
79
86
80
-
The identity of a record is determined by its attribute/value pairs. Two records with the same attributes and values are identical in Eve. We included the `event` attribute in the `#clicked` record to differentiate each record. Without this differentiation, we could only ever create a single `#clicked` record.
87
+
The identity of a record is determined by its attribute/value pairs. Two records with the same attributes and values are the same record in Eve. We included the `event` attribute in the `#clicked` record to differentiate each record. Without this differentiation, we could only ever create a single `#clicked` record.
81
88
82
89
## Count the number of clicks
83
90
@@ -109,11 +116,4 @@ This will get you started with Eve, but there's still more to learn. From here,
109
116
- Advance to Level 2 of the introductory tutorial (coming soon).
110
117
- View the [syntax reference](../syntaxreference) or the [library reference](../handbook/libraries).
111
118
- Explore already made [examples](https://github.com/witheve/eve-examples).
112
-
- Or dive right in to the editor and try out the concepts you've just learned (coming soon).
113
-
114
-
## Appendix
115
-
116
-
~~~eve
117
-
commit
118
-
[#time #system/timer resolution: 1000]
119
-
~~~
119
+
- Or dive right in to the editor and try out the concepts you've just learned (coming soon).
0 commit comments