mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
withPluginApi
means you don't have to check for null.
This commit is contained in:
parent
3ea1f88cdc
commit
3a78321c63
4 changed files with 22 additions and 14 deletions
|
@ -1,11 +1,11 @@
|
|||
import { getPluginApi } from 'discourse/lib/plugin-api';
|
||||
import { withPluginApi } from 'discourse/lib/plugin-api';
|
||||
|
||||
export default {
|
||||
name: "apply-details",
|
||||
|
||||
initialize() {
|
||||
const api = getPluginApi('0.1');
|
||||
api.decorateCooked($elem => $("details", $elem).details());
|
||||
withPluginApi('0.1', api => {
|
||||
api.decorateCooked($elem => $("details", $elem).details());
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue