-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
31 lines (29 loc) · 1.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head>
<link rel="stylesheet" href="./dist/doov-react.css" />
</head>
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
<!-- Don't use this in production: -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://unpkg.com/doov@0.11.0/dist/doov.js"></script>
<script src="./dist/doov-react.js"></script>
<script type="text/babel">
const DoovReact = DoovReact.DoovReact;
const num = DOOV.lift(DOOV.NumberFunction, 4);
const f = DOOV.f(DOOV.field('toto'));
const o = { toto: 'value', titi: 5 };
const mappingRule = DOOV.map(num).to(f);
const validationRule = DOOV.when(f.eq(num)).validate();
ReactDOM.render(
<div className="doov-react">
<DoovReact metadata={mappingRule.metadata} fields={{ toto: 'toto' }} />
<DoovReact metadata={validationRule.metadata} fields={{ toto: 'toto' }} />
</div>,
document.getElementById('app')
);
</script>
<body>
<div id="app"></div>
</body>
</html>