decue 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@ Based on ideas in https://github.com/kgscialdone/facet (Thank you very much!) th
15
15
  - Allows giving parameter data to elements.
16
16
  - as slots for structured data: named and unnamed, also without shadow DOM (though mind the differences to native slots).
17
17
  - as attributes for textual data: referenced by {placeholders} in template content.
18
- - Supports function and method piping in placeholders, e.g. `{name|.toUpperCase|someGlobalFunc}`.
18
+ - Supports function and method piping in placeholders, e.g. `{name.toUpperCase|someRegisteredFunction}`.
19
19
  - Supports form-associated custom elements.
20
20
  - I currently don't have actual use cases. Please let me know if you need some functionality!
21
21
  - Allows event handler binding via `decue-on:eventname` attributes.
@@ -60,6 +60,20 @@ If you want to have elements already defined when the DOM is parsed to remove fl
60
60
  <script elements="my-element my-other-element[observed1,observed2]">
61
61
  ```
62
62
 
63
+ ### Functions for piping
64
+
65
+ You can invoke object properties and methods in the pipes, but you can only include explicitly registered functions. They can be registered with the _functions_ attribute, separated by spaces. Non-global functions can be given an alias as a simple name:
66
+
67
+ ```html
68
+ <script>
69
+ function myLowercase(str) {
70
+ return str.toLowerCase();
71
+ }
72
+ </script>
73
+
74
+ <script functions="myLowercase myAlias:window.someModule.someFunction"></script>
75
+ ```
76
+
63
77
  ### External elements
64
78
 
65
79
  You can include elements defined in external files using an `<object>` tag: