Skip to content

Commit

Permalink
Add caveat on the stateless natural of plug-ins
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Mar 8, 2016
1 parent 176fe8d commit 38af3f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ This section serves as a simple walkthrough to how plug-ins work in MacDown unti

A plugin in MacDown is a regular Cocoa [dynamic-loading bundle], with extension `.plugin`. MacDown searches `~/Library/Application Support/MacDown/PlugIns`, and build menu items for loadable bundles inside the directory. A plug-in in invoked when the user clicks on its corresponding menu item.

One caveat is that MacDown does *not* reuse plug-in instances between invocations; a new instance of re-created each time a method is called on the plug-in. This may change in the future, but as a rule of thumb, you should always treat your plug-in as stateless. Store things with `NSUserDefaults` or other persistence solutions.

[dynamic-loading bundle]: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingCode/LoadingCode.html#//apple_ref/doc/uid/10000052-SW1


Expand Down

0 comments on commit 38af3f3

Please sign in to comment.