Skip to content

Commit

Permalink
refactor: simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
veinfors committed Mar 20, 2023
1 parent 2c7cb55 commit ecfdacb
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions apis/nucleus/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,8 @@ function nuked(configuration = {}) {
}
const onSelectionActivated = () => fieldSels.emit('selectionActivated');
const onSelectionDeactivated = () => fieldSels.emit('selectionDeactivated');
let renderCount = 0;

return new Promise((resolve) => {
const renderedCallback = () => {
renderCount++;
if (renderCount === 1) {
resolve();
}
};

this._instance = ListBoxPortal({
element,
app,
Expand All @@ -483,7 +475,7 @@ function nuked(configuration = {}) {
...options,
}),
stateName: options.stateName || '$',
renderedCallback,
renderedCallback: resolve,
});
root.add(this._instance);
});
Expand Down

0 comments on commit ecfdacb

Please sign in to comment.