You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/guides/api.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,9 +90,9 @@ Not handling the lifecycle of mountable objects can lead to memory leaks and oth
90
90
Lifecycle management is very important when working with the Meta Bind API. You need to make sure that you clean up after yourself to prevent memory leaks and other bugs.
91
91
92
92
Most things that need lifecycle managment inherit from [`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable), which has a `mount` and `unmount` method.
93
-
If you call `mount` you nned to also call `unmount` at some point.
93
+
If you call `mount`, you need to call `unmount` at some point.
94
94
95
-
The API also provides a helper function called `wrapInMDRC` that can be used to handle the lifecycle of a mountable object for you.
95
+
The API provides a helper function called `wrapInMDRC` that can be used to handle the lifecycle of a mountable object for you.
In the background this will create a [`MarkdownRenderChild`](https://docs.obsidian.md/Reference/TypeScript+API/MarkdownRenderChild)
108
-
which mounts and unmounts the mountable on load and unload respectivly and then registers that as a child of the component.
108
+
which mounts and unmounts the mountable on load and unload respectivly and then registers that [`MarkdownRenderChild`](https://docs.obsidian.md/Reference/TypeScript+API/MarkdownRenderChild) as a child of the component.
109
109
110
110
You can also handle the lifecycle yourself by mounting the mountable to the DOM and then registering a callback to unmount it when the component is destroyed.
The following examples use `js-engine` code blocks from the [JS Engine](https://github.com/mProjectsCode/obsidian-js-engine-plugin) plugin.
126
-
To use the examples as they are, make sure you have the [JS Engine](https://github.com/mProjectsCode/obsidian-js-engine-plugin) plugin installed and enabled
127
-
Though the API is usable without it, the examples might not work without it.
126
+
To use the examples as they are, make sure you have the [JS Engine](https://github.com/mProjectsCode/obsidian-js-engine-plugin) plugin installed and enabled.
127
+
Though the API is usable without it, the examples might not work without [JS Engine](https://github.com/mProjectsCode/obsidian-js-engine-plugin).
128
128
129
129
The used globals that are exclusive to JS Engine are as follows.
130
130
For more information on them refer to the [JS Engine documentation](https://www.moritzjung.dev/obsidian-js-engine-plugin-docs/api/interfaces/jsexecutionglobals/).
0 commit comments