Skip to content

Instantly share code, notes, and snippets.

@mweststrate
Last active May 9, 2024 12:55
Show Gist options
  • Save mweststrate/bcb834af0254709ae16398dbce51e93f to your computer and use it in GitHub Desktop.
Save mweststrate/bcb834af0254709ae16398dbce51e93f to your computer and use it in GitHub Desktop.
circular-deps-4
// -- app.js --
import { AbstractNode } from './internal'
/* as is */
// -- internal.js --
export * from './AbstractNode'
export * from './Node'
export * from './Leaf'
// -- AbstractNode.js --
import { Node, Leaf } from './internal'
export class AbstractNode {
/* as is */
}
// -- Node.js --
import { AbstractNode } from './internal'
export class Node extends AbstractNode {
/* as is */
}
// -- Leaf.js --
import { AbstractNode } from './internal'
export class Leaf extends AbstractNode {
/* as is */
}
@Tuditi
Copy link

Tuditi commented Jan 17, 2023

How come l.12 doesn't result in a circular dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment