mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
withPluginApi
means you don't have to check for null.
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
import { getPluginApi } from 'discourse/lib/plugin-api';
|
||||
import { withPluginApi } from 'discourse/lib/plugin-api';
|
||||
|
||||
export default {
|
||||
name: "apply-lazyYT",
|
||||
initialize() {
|
||||
const api = getPluginApi('0.1');
|
||||
api.decorateCooked($elem => $('.lazyYT', $elem).lazyYT());
|
||||
withPluginApi('0.1', api => {
|
||||
api.decorateCooked($elem => $('.lazyYT', $elem).lazyYT());
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user