Skip to content

Commit 510bdc0

Browse files
authored
Merge pull request #697 from rbasso/react-schema
react: Make exercise schema-compliant
2 parents 9d40e5d + 8feaf6a commit 510bdc0

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

exercises/react/canonical-data.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"#": [
2+
"exercise": "react",
3+
"version": "1.0.0",
4+
"comments": [
35
"Note that, due to the nature of this exercise,",
46
"the tests are specified using their cells and a series of operations to perform on the cells.",
57
"",
@@ -43,6 +45,7 @@
4345
"cases": [
4446
{
4547
"description": "input cells have a value",
48+
"property": "react",
4649
"cells": [
4750
{
4851
"name": "input",
@@ -60,6 +63,7 @@
6063
},
6164
{
6265
"description": "an input cell's value can be set",
66+
"property": "react",
6367
"cells": [
6468
{
6569
"name": "input",
@@ -82,6 +86,7 @@
8286
},
8387
{
8488
"description": "compute cells calculate initial value",
89+
"property": "react",
8590
"cells": [
8691
{
8792
"name": "input",
@@ -105,6 +110,7 @@
105110
},
106111
{
107112
"description": "compute cells take inputs in the right order",
113+
"property": "react",
108114
"cells": [
109115
{
110116
"name": "one",
@@ -133,6 +139,7 @@
133139
},
134140
{
135141
"description": "compute cells update value when dependencies are changed",
142+
"property": "react",
136143
"cells": [
137144
{
138145
"name": "input",
@@ -161,6 +168,7 @@
161168
},
162169
{
163170
"description": "compute cells can depend on other compute cells",
171+
"property": "react",
164172
"cells": [
165173
{
166174
"name": "input",
@@ -206,6 +214,7 @@
206214
},
207215
{
208216
"description": "compute cells fire callbacks",
217+
"property": "react",
209218
"cells": [
210219
{
211220
"name": "input",
@@ -239,6 +248,7 @@
239248
},
240249
{
241250
"description": "callback cells only fire on change",
251+
"property": "react",
242252
"cells": [
243253
{
244254
"name": "input",
@@ -282,6 +292,7 @@
282292
},
283293
{
284294
"description": "callbacks can be added and removed",
295+
"property": "react",
285296
"cells": [
286297
{
287298
"name": "input",
@@ -345,11 +356,12 @@
345356
},
346357
{
347358
"description": "removing a callback multiple times doesn't interfere with other callbacks",
348-
"#": [
359+
"comments": [
349360
"Some incorrect implementations store their callbacks in an array",
350361
"and removing a callback repeatedly either removes an unrelated callback",
351362
"or causes an out of bounds access."
352363
],
364+
"property": "react",
353365
"cells": [
354366
{
355367
"name": "input",
@@ -408,10 +420,11 @@
408420
},
409421
{
410422
"description": "callbacks should only be called once even if multiple dependencies change",
411-
"#": [
423+
"comments": [
412424
"Some incorrect implementations call a callback function too early,",
413425
"when not all of the inputs of a compute cell have propagated new values."
414426
],
427+
"property": "react",
415428
"cells": [
416429
{
417430
"name": "input",
@@ -463,11 +476,12 @@
463476
},
464477
{
465478
"description": "callbacks should not be called if dependencies change but output value doesn't change",
466-
"#": [
479+
"comments": [
467480
"Some incorrect implementations simply mark a compute cell as dirty when a dependency changes,",
468481
"then call callbacks on all dirty cells.",
469482
"This is incorrect since the specification indicates only to call callbacks on change."
470483
],
484+
"property": "react",
471485
"cells": [
472486
{
473487
"name": "input",

0 commit comments

Comments
 (0)