Skip to content

Commit 38ea1a5

Browse files
authored
Merge pull request #34 from leapfrogtechnology/unreachable-code
Remove unreachable code
2 parents cefc3e7 + 88cf2bd commit 38ea1a5

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/impl/domain.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import StoreDomainInterface, { STORE_KEY, ID_KEY } from '../StoreDomain';
1010
const logDomain = debug(STORE_DOMAIN);
1111

1212
/**
13-
* Initialize the store domain and enable
14-
* all the async middelwares / callacks triggered
15-
* via the provided callback to have access to the store.
13+
* Initialize the store domain and enable all the async
14+
* middlewares/callbacks triggered via the provided
15+
* callback to have access to the store.
1616
*
1717
* @param {AsyncStoreParams} params
1818
*/
@@ -58,19 +58,19 @@ function bindParams(d: StoreDomainInterface, params: AsyncStoreParams): void {
5858
}
5959

6060
/**
61-
* Create or use active domain. If domain is already intialized in application it uses existing
62-
* domain else create new domain object.
61+
* Create or use active domain. If domain is already initialized
62+
* in application it uses existing domain else create new
63+
* domain object.
6364
*
6465
* @returns {StoreDomainInterface}
6566
*/
6667
function createOrUseActiveDomain(): StoreDomainInterface {
6768
if (isDomainInitialized()) {
6869
logDomain(`Using active domain.`);
6970

70-
/*
71-
* Some packages like Raven uses domain to handle exception which might overwrite async store domain.
72-
* For more information: https://github.com/getsentry/sentry-javascript.
73-
*/
71+
// Some packages like Raven (sentry) uses domain to handle exception
72+
// which might overwrite async store domain.
73+
// For more information: https://github.com/getsentry/sentry-javascript.
7474
return getActiveDomain();
7575
}
7676

@@ -205,10 +205,6 @@ export function isInitialized(): boolean {
205205
function updateStore(store: StoreDomainInterface, properties: any) {
206206
const activeDomain = getActiveDomain();
207207

208-
if (!activeDomain) {
209-
throw new Error('No active domain found in store.');
210-
}
211-
212208
const data = mergeDeepRight(store, properties);
213209

214210
logDomain('Updating store.');
@@ -228,7 +224,7 @@ export function getActiveDomain(): StoreDomainInterface {
228224
}
229225

230226
/**
231-
* Get's the unique domain id created for the current context / scope.
227+
* Gets the unique domain id created for the current context / scope.
232228
*
233229
* @returns {(string | undefined)}
234230
*/

0 commit comments

Comments
 (0)