Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nodegui/nodegui",
"version": "0.16.0",
"version": "0.16.1",
"description": "A cross platform library to build native desktop apps.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -33,6 +33,7 @@
"cross-env": "^7.0.0",
"cuid": "^2.1.6",
"manage-path": "^2.0.0",
"memoize-one": "^5.1.1",
"node-addon-api": "^2.0.0",
"postcss-nodegui-autoprefixer": "0.0.7",
"prebuild-install": "^5.3.3"
Expand Down
4 changes: 4 additions & 0 deletions src/lib/QtWidgets/QWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { QRect } from '../QtCore/QRect';
import { QObjectSignals } from '../QtCore/QObject';
import { QFont } from '../QtGui/QFont';
import { QAction } from './QAction';
import memoizeOne from 'memoize-one';

/**

Expand Down Expand Up @@ -56,6 +57,9 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
constructor(native: NativeElement) {
super(native);
this.actions = new Set<QAction>();
this.setStyleSheet = memoizeOne(this.setStyleSheet);
this.setInlineStyle = memoizeOne(this.setInlineStyle);
this.setObjectName = memoizeOne(this.setObjectName);
}
show(): void {
this.native.show();
Expand Down
11 changes: 6 additions & 5 deletions src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ export function checkIfNapiExternal(arg: any): boolean {
return addon.NUtils.isNapiExternal(arg);
}

function noop(): void {
return;
}
// function noop(): void {
// return;
// }

export const wrapWithActivateUvLoop = (func: Function) => {
return (...args: any[]): any => {
const activateUvLoop = (process as any).activateUvLoop || noop;
activateUvLoop();
// Temporarily removing activateUvLoop
// const activateUvLoop = (process as any).activateUvLoop || noop;
// activateUvLoop();
return func(...args);
};
};