withPluginApi means you don't have to check for null.

This commit is contained in:
Robin Ward
2016-02-16 12:17:22 -05:00
parent 3ea1f88cdc
commit 3a78321c63
4 changed files with 22 additions and 14 deletions

View File

@ -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());
});
}
};