aberdeen 0.5.0 → 1.0.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 +5 -1
- package/dist/aberdeen.d.ts +17 -2
- package/dist/aberdeen.js.map +2 -2
- package/dist-min/aberdeen.js.map +2 -2
- package/package.json +1 -1
- package/src/aberdeen.ts +17 -2
package/src/aberdeen.ts
CHANGED
|
@@ -1133,7 +1133,10 @@ export function proxy(target: TargetType): TargetType {
|
|
|
1133
1133
|
* setTimeout(() => rawUser.name += '?', 2000);
|
|
1134
1134
|
*
|
|
1135
1135
|
* // Both userProxy and rawUser end up as `{name: 'Frank!?'}`
|
|
1136
|
-
* setTimeout(() =>
|
|
1136
|
+
* setTimeout(() => {
|
|
1137
|
+
* console.log('final proxied', userProxy)
|
|
1138
|
+
* console.log('final unproxied', rawUser)
|
|
1139
|
+
* }, 3000);
|
|
1137
1140
|
* ```
|
|
1138
1141
|
*/
|
|
1139
1142
|
export function unproxy<T>(target: T): T {
|
|
@@ -1725,7 +1728,7 @@ let onError: (error: Error) => boolean | undefined = defaultOnError;
|
|
|
1725
1728
|
*
|
|
1726
1729
|
* try {
|
|
1727
1730
|
* // Attempt to show a custom message in the UI
|
|
1728
|
-
* $('div.error-
|
|
1731
|
+
* $('div.error-message:Oops, something went wrong!');
|
|
1729
1732
|
* } catch (e) {
|
|
1730
1733
|
* // Ignore errors during error handling itself
|
|
1731
1734
|
* }
|
|
@@ -1733,8 +1736,20 @@ let onError: (error: Error) => boolean | undefined = defaultOnError;
|
|
|
1733
1736
|
* return false; // Suppress default console log and DOM error message
|
|
1734
1737
|
* });
|
|
1735
1738
|
*
|
|
1739
|
+
* // Styling for our custom error message
|
|
1740
|
+
* insertCss({
|
|
1741
|
+
* '.error-message': {
|
|
1742
|
+
* backgroundColor: '#e31f00',
|
|
1743
|
+
* display: 'inline-block',
|
|
1744
|
+
* color: 'white',
|
|
1745
|
+
* borderRadius: '3px',
|
|
1746
|
+
* padding: '2px 4px',
|
|
1747
|
+
* }
|
|
1748
|
+
* }, true); // global style
|
|
1749
|
+
*
|
|
1736
1750
|
* // Cause an error within a render scope.
|
|
1737
1751
|
* $('div.box', () => {
|
|
1752
|
+
* // Will cause our error handler to insert an error message within the box
|
|
1738
1753
|
* noSuchFunction();
|
|
1739
1754
|
* })
|
|
1740
1755
|
* ```
|