Skip to content

Commit

Permalink
fix: change to theta since we already use for private stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt committed Mar 22, 2024
1 parent 2d575ac commit a1a872d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/store/src/internal/unhandled-rxjs-error-callback.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { config } from 'rxjs';

const __unhandledRxjsErrorCallbacks = new WeakMap<any, VoidFunction>();
const ɵɵunhandledRxjsErrorCallbacks = new WeakMap<any, VoidFunction>();

const existingHandler = config.onUnhandledError;
config.onUnhandledError = function (error: any) {
const unhandledErrorCallback = __unhandledRxjsErrorCallbacks.get(error);
const unhandledErrorCallback = ɵɵunhandledRxjsErrorCallbacks.get(error);
if (unhandledErrorCallback) {
unhandledErrorCallback();
} else if (existingHandler) {
Expand All @@ -15,7 +15,7 @@ config.onUnhandledError = function (error: any) {
};

export function executeUnhandledCallback(error: any) {
const unhandledErrorCallback = __unhandledRxjsErrorCallbacks.get(error);
const unhandledErrorCallback = ɵɵunhandledRxjsErrorCallbacks.get(error);
if (unhandledErrorCallback) {
unhandledErrorCallback();
return true;
Expand All @@ -29,7 +29,7 @@ export function assignUnhandledCallback(error: any, callback: VoidFunction) {
// The error can also be a string if thrown in the following manner: `throwError('My Error')`.
if (error !== null && typeof error === 'object') {
let hasBeenCalled = false;
__unhandledRxjsErrorCallbacks.set(error, () => {
ɵɵunhandledRxjsErrorCallbacks.set(error, () => {
if (!hasBeenCalled) {
hasBeenCalled = true;
callback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('Dispatching an empty array with errors (https://github.com/ngxs/store/
expect(subscription.closed).toEqual(true);
});

it('dispatch([ new ActionEmptyArray(), new ActionDispatchError() ])', async () => {
it('dispatch([ new ActionEmptyArray(), new ActionDispatchError() ])', () => {
subscription = store
.dispatch([new ActionEmptyArray(), new ActionDispatchError()])
.pipe(finalize(() => events.push('finalize')))
Expand Down

0 comments on commit a1a872d

Please sign in to comment.