refactor(svelte/edges): simplify
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { memo, useMemo } from 'react';
|
||||
|
||||
import { SmoothStepEdge } from './SmoothStepEdge';
|
||||
import type { SmoothStepEdgeProps } from '../../types';
|
||||
import type { StepEdgeProps } from '../../types';
|
||||
|
||||
function createStepEdge(params: { isInternal: boolean }) {
|
||||
// eslint-disable-next-line react/display-name
|
||||
return memo(({ id, ...props }: SmoothStepEdgeProps) => {
|
||||
return memo(({ id, ...props }: StepEdgeProps) => {
|
||||
const _id = params.isInternal ? undefined : id;
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// We distinguish between internal and exported edges
|
||||
// The internal edges are used directly like custom edges and always get an id, source and target props
|
||||
// If you import an edge from the library, the id is optional and source and target are not used at all
|
||||
|
||||
export { SimpleBezierEdge, SimpleBezierEdgeInternal } from './SimpleBezierEdge';
|
||||
export { SmoothStepEdge, SmoothStepEdgeInternal } from './SmoothStepEdge';
|
||||
export { StepEdge, StepEdgeInternal } from './StepEdge';
|
||||
|
||||
Reference in New Issue
Block a user