Sam
DIAdiscord.js - Imagine an app
•Created by Sam on 12/7/2023 in #djs-questions
How are circular Dependancies avoided in Djs
in djs, guilds needs to have roles:
<guild>.roles
and a role needs to have a guild: <role>.guild
how does this not result in a circular dependency of the guild
and role
classes in https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/Role.js#L15
and
https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/Guild.js#L155 replies