Skip to content

Commit

Permalink
fix: reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Artyom Melichow committed Sep 1, 2023
1 parent d158d61 commit 3d755c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
16 changes: 6 additions & 10 deletions addon/modifiers/-private/ember-tabulator-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@ export default class EmberTabulatorInitModifier extends Modifier {
}

modify(element, [options], { onUpdate }) {
if (!this.tabulator) {
this.tabulator = new Tabulator(element, {
reactiveData: true,
...options,
});
options.events?.forEach((event) => {
this.tabulator.on(event.name, event.callback);
});
onUpdate?.(this.tabulator);
}
this.tabulator?.destroy();
this.tabulator = new Tabulator(element, options);
options.events?.forEach((event) => {
this.tabulator.on(event.name, event.callback);
});
onUpdate?.(this.tabulator);
}
}
1 change: 0 additions & 1 deletion addon/templates/components/ember-tabulator.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div
class="ember-tabulator"
...attributes
{{did-update this.updateData @data}}
{{-private/ember-tabulator-init this.args onUpdate=this.setInstance}}
>
{{#if (has-block)}}
Expand Down

0 comments on commit 3d755c0

Please sign in to comment.