mirror of
https://github.com/rajnandan1/kener.git
synced 2026-08-07 07:14:56 +00:00
Merge pull request #783 from lokiee0/feature/reactive-chart-id
Refactor chartId to use $derived for reactive updates
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
config: ChartConfig;
|
||||
} = $props();
|
||||
|
||||
const chartId = `chart-${id || uid.replace(/:/g, "")}`;
|
||||
const chartId = $derived(`chart-${id || uid.replace(/:/g, "")}`);
|
||||
|
||||
setChartContext({
|
||||
get config() {
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
|
||||
type ToggleVariants = VariantProps<typeof toggleVariants>;
|
||||
|
||||
interface ToggleGroupContext extends ToggleVariants {
|
||||
spacing?: number;
|
||||
interface ToggleGroupContext {
|
||||
get variant(): ToggleVariants["variant"];
|
||||
get size(): ToggleVariants["size"];
|
||||
get spacing(): number | undefined;
|
||||
}
|
||||
|
||||
export function setToggleGroupCtx(props: ToggleGroupContext) {
|
||||
@@ -33,9 +35,15 @@
|
||||
}: ToggleGroupPrimitive.RootProps & ToggleVariants & { spacing?: number } = $props();
|
||||
|
||||
setToggleGroupCtx({
|
||||
variant,
|
||||
size,
|
||||
spacing,
|
||||
get variant() {
|
||||
return variant;
|
||||
},
|
||||
get size() {
|
||||
return size;
|
||||
},
|
||||
get spacing() {
|
||||
return spacing;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import dns2 from "dns2";
|
||||
import dgram, { type Socket } from "dgram";
|
||||
import tls from "tls";
|
||||
import { Resolver as NodeResolver } from "node:dns/promises";
|
||||
import { AllRecordTypes, IsValidHost, ValidateIpAddress } from "../clientTools";
|
||||
import { AllRecordTypes, IsValidHost } from "../clientTools";
|
||||
|
||||
interface DNSAnswer {
|
||||
name: string;
|
||||
@@ -135,7 +135,6 @@ class DNSResolver {
|
||||
const port = options.tlsPort ?? DEFAULT_DOT_PORT;
|
||||
const timeoutMs = options.timeoutMs ?? DEFAULT_QUERY_TIMEOUT_MS;
|
||||
const servername = this.resolveTlsServername(nameserver, options.tlsServername);
|
||||
const ipType = ValidateIpAddress(nameserver);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let responseBuffer = Buffer.alloc(0);
|
||||
@@ -146,7 +145,6 @@ class DNSResolver {
|
||||
port,
|
||||
servername,
|
||||
rejectUnauthorized: !options.allowSelfSignedCert,
|
||||
family: ipType === "IP6" ? 6 : ipType === "IP4" ? 4 : undefined,
|
||||
});
|
||||
|
||||
const timeoutId = setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user