-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add worker decorator #1147
Add worker decorator #1147
Conversation
d56c39b
to
d588d5a
Compare
d588d5a
to
37967ca
Compare
@@ -21,7 +21,7 @@ export function Debounce(timeout: number = DEFAULT_TIMEOUT): MethodDecorator { | |||
timeoutRef = window.setTimeout((): void => { | |||
const result: Any = originalMethod.apply(this, args); | |||
|
|||
if (isDevMode() && isNotNil(result)) { | |||
if (isDevMode() && Boolean(isNotNil(result))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidentally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
@@ -0,0 +1,15 @@ | |||
import { Any, Descriptor } from '@angular-ru/cdk/typings'; | |||
|
|||
import { WebWorkerThreadService as Thread } from './worker-thread.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it will be better to import WorkerThread
?
I got such an idea about workers with webpack loader. We have three problems with current solution:
So i suggest to make a webworker webpack loader. It will force user to separate the side function at least outside the lexical environment (namely, to the separate file) — 1. import('worker-loader!./some-fn.worker.ts').then(({ someFn }) => someFn(someData)) As we move the code to separate file, webpack can correctly import any symbols to it — 2. The third problem can be solved with SharedArrayBuffer, but I'm not sure. Wyt? Isn't it an overhead? |
our webworker service - it's redundant for production, but only just for fun utils. We need migrate to native webpack loader from angular |
ed9da54
to
8c1e743
Compare
1252b9b
to
720da90
Compare
Do you comment anything here? Cause i'm receiving notifications periodically, but see not updates. |
@Schirbak hello, postponed, I will answer your suggestions asap |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?