Skip to content

Commit 19b2dcf

Browse files
Merge pull request #15 from efflore/feature/0.8.3
Feature/0.8.3
2 parents 6a76d5c + b4c848e commit 19b2dcf

29 files changed

+928
-1474
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
root = true
22

33
[*]
4-
indent_style = space
5-
indent_size = 2
4+
indent_style = tab
5+
indent_size = 4
66
end_of_line = lf
77
charset = utf-8

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
UIElement - the "look ma, no JS framework!" library bringing signals-based reactivity to vanilla Web Components
44

5-
Version 0.8.2
5+
Version 0.8.3
66

77
## What is UIElement?
88

@@ -24,7 +24,7 @@ There are 7 pre-defined auto-effects that can be applied on elements with `this.
2424
- `toggleAttribute(name, state=name)`: toggles a boolean attribute on the element according to the value of state; expects a state of type boolean
2525
- `toggleClass(token, state=token)`: toggles a class on the element according to the value of state; expects a state of type boolean
2626
- `setStyle(prop, state=prop)`: set an inline style on the element to the value of state; expects a state of type string for the CSS property value
27-
- `dispatch(event, state=event)`: dispatch a custom event with the value of state as detail; accepts a state of any type
27+
- `emit(event, state=event)`: dispatch a custom event with the value of state as detail; accepts a state of any type
2828

2929
You can define custom effects with `effect()`, either in the `connectedCallback()` or in a mapped function on `this.[self|first(selector)|all(selector)]`. `UIElement` will automatically trigger these effects and bundle the fine-grained DOM updates.
3030

cause-effect.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@ const isDefinedObject = (value) => isDefined(value) && (isObject(value) || isFun
1010
const hasMethod = (obj, name) => isFunction(obj[name]);
1111

1212
/* === Types === */
13-
/* type Log<A> = {
14-
(): A
15-
map: <B>(f: (a: A) => B, mapMsg?: string, mapLevel?: LogLevel) => Log<B>
16-
chain: <B>(f: (a: A) => Log<B>) => Log<B>
17-
} */
1813
/* === Constants === */
1914
const LOG_DEBUG = 'debug';
2015
const LOG_WARN = 'warn';
2116
const LOG_ERROR = 'error';
22-
/* === Internal Functions === */
23-
const shouldLog = (level) => (level === LOG_WARN) || (level === LOG_ERROR);
2417
/* === Default Export */
2518
const log = (value, msg, level = LOG_DEBUG) => {
26-
if (shouldLog(level))
19+
if ([LOG_ERROR, LOG_WARN].includes(level))
2720
console[level](msg, value);
2821
return value;
2922
};

cause-effect.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)