Skip to content

Commit

Permalink
0.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Mar 30, 2024
1 parent f148e85 commit 313cbf4
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 177 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ When a target is specified (as above), it will automatically set the target's ar

Like [*be-kvetching*](https://github.com/bahrus/be-kvetching), *be-fetching* can dynamically turn an unknown element into a web component, where that web component serves as a non visible "web component as a service". But *be-fetching* adds a few bells and whistles on top of what *be-kvetching* provides:

1. It can integrate near-by input or form associated elements, in order to formulate the url, as well as the (POST) body.
2. It can make the element it adorns a form-associated element.
3. It can adjust the output of the fetch request via inline script expressions.
1. It can integrate near-by input or form associated elements, in order to formulate the url, as well as the (POST) body. [TODO]
2. It can make the element it adorns a form-associated element. [TODO]
3. It can adjust the output of the fetch request via inline script expressions. [TODO]

Sample markup:

Expand All @@ -63,7 +63,8 @@ Sample markup:
<input id=expression value="x^2">
<newton-microservice
for="operation expression"
be-fetching oninput="({operation, expression}) => ({
be-fetching
oninput="({operation, expression}) => ({
//can also hard code href attribute if it is a constant
href: `https://newton.now.sh/api/v2/${operation}/${expression}`
})"
Expand All @@ -89,7 +90,7 @@ To only recalculate it when focus is lost, add the onchange attribute.
<newton-microservice
for="operation expression"
oninput="({operation, expression}) => ({
href: `https://newton.now.sh/api/v2/${operation}/${expression`}`
href: `https://newton.now.sh/api/v2/${operation}/${expression}`
})"
be-fetching onchange
target=json-viewer[-object]
Expand Down
10 changes: 5 additions & 5 deletions demo/Example1.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<script type=importmap>
{
"imports": {
"be-enhanced/": "../node_modules/be-enhanced/",
"be-hive/": "../node_modules/be-hive/",
"mount-observer/": "../node_modules/mount-observer/",
"trans-render/": "../node_modules/trans-render/",
"xtal-element/": "../node_modules/xtal-element/"
"be-enhanced/": "/node_modules/be-enhanced/",
"be-hive/": "/node_modules/be-hive/",
"mount-observer/": "/node_modules/mount-observer/",
"trans-render/": "/node_modules/trans-render/",
"xtal-element/": "/node_modules/xtal-element/"
}
}
</script>
Expand Down
10 changes: 5 additions & 5 deletions demo/Example2.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<script type=importmap>
{
"imports": {
"be-enhanced/": "../node_modules/be-enhanced/",
"be-hive/": "../node_modules/be-hive/",
"mount-observer/": "../node_modules/mount-observer/",
"trans-render/": "../node_modules/trans-render/",
"xtal-element/": "../node_modules/xtal-element/"
"be-enhanced/": "/node_modules/be-enhanced/",
"be-hive/": "/node_modules/be-hive/",
"mount-observer/": "/node_modules/mount-observer/",
"trans-render/": "/node_modules/trans-render/",
"xtal-element/": "/node_modules/xtal-element/"
}
}
</script>
Expand Down
14 changes: 7 additions & 7 deletions demo/Example4.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example 3</title>
<title>Example 4</title>
<script type=importmap>
{
"imports": {
"be-enhanced/": "../node_modules/be-enhanced/",
"be-hive/": "../node_modules/be-hive/",
"mount-observer/": "../node_modules/mount-observer/",
"trans-render/": "../node_modules/trans-render/",
"xtal-element/": "../node_modules/xtal-element/"
"be-enhanced/": "/node_modules/be-enhanced/",
"be-hive/": "/node_modules/be-hive/",
"mount-observer/": "/node_modules/mount-observer/",
"trans-render/": "/node_modules/trans-render/",
"xtal-element/": "/node_modules/xtal-element/"
}
}
</script>
Expand All @@ -26,7 +26,7 @@
<label for=expression>Expression:</label>
<input id=expression value="x^2">
<newton-microservice
for="operation expression"
for="@operation @expression"
oninput="({operation, expression}) => ({
url: `https://newton.now.sh/api/v2/${operation}/${expression}`
})"
Expand Down
Loading

0 comments on commit 313cbf4

Please sign in to comment.