@logux/client
Advanced tools
Comparing version 0.14.7 to 0.15.0
@@ -0,1 +1,2 @@ | ||
import { AbstractActionCreator } from '@logux/actions' | ||
import { Unsubscribe } from 'nanoevents' | ||
@@ -259,2 +260,12 @@ import { | ||
/** | ||
* @param actionCreator Action creator function. | ||
* @param callbacks Callbacks for action created by creator. | ||
*/ | ||
type<Creator extends AbstractActionCreator>( | ||
actionCreator: Creator, | ||
listener: ClientActionListener<ReturnType<Creator>>, | ||
opts?: { id?: string; event?: 'preadd' | 'add' | 'clean' } | ||
): Unsubscribe | ||
/** | ||
* Subscribe for synchronization events. It implements Nano Events API. | ||
@@ -261,0 +272,0 @@ * Supported events: |
@@ -306,2 +306,3 @@ import { createNanoEvents } from 'nanoevents' | ||
type(type, listener, opts) { | ||
if (typeof type === 'function') type = type.type | ||
return this.log.type(type, listener, opts) | ||
@@ -308,0 +309,0 @@ } |
@@ -7,9 +7,15 @@ import { parseId } from '@logux/core' | ||
function showLog(text, details) { | ||
const RED = '#c00000' | ||
function showLog(text, details, color) { | ||
text = '%cLogux%c ' + text | ||
let args = Array.from(text.match(/%c/g)).map((_, i) => { | ||
if (i === 0) { | ||
return 'color:#ffa200;font-weight:bold' | ||
if (color === RED) { | ||
return `color:${color};font-weight:bold` | ||
} else { | ||
return 'color:#ffa200;font-weight:bold' | ||
} | ||
} else if (i % 2 === 0) { | ||
return 'font-weight:bold' | ||
return color ? `font-weight:bold;color:${color}` : 'font-weight:bold' | ||
} else { | ||
@@ -140,3 +146,3 @@ return 'font-weight:normal' | ||
} | ||
showLog(message, details) | ||
showLog(message, details, RED) | ||
} else { | ||
@@ -154,3 +160,3 @@ let details = { Action: action, Meta: meta } | ||
} | ||
showLog(message, details) | ||
showLog(message, details, '#008000') | ||
} | ||
@@ -157,0 +163,0 @@ }) |
{ | ||
"name": "@logux/client", | ||
"version": "0.14.7", | ||
"version": "0.15.0", | ||
"description": "Logux base components to build web client", | ||
@@ -65,8 +65,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@logux/actions": "^0.2.1", | ||
"@logux/actions": "^0.2.2", | ||
"fast-json-stable-stringify": "^2.1.0", | ||
"nanodelay": "^2.0.2", | ||
"nanoevents": "^6.0.2", | ||
"nanoid": "^3.2.0" | ||
"nanoid": "^3.3.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145098
4832
Updated@logux/actions@^0.2.2
Updatednanoid@^3.3.1