Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit f5b480b

Browse files
author
Matthew Ault
committed
rm checks to disallow adding middleware post-init
https://segment.atlassian.net/browse/LIB-1749
1 parent 4c08f5b commit f5b480b

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

lib/analytics.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ Analytics.prototype.addIntegration = function(Integration) {
105105
*/
106106

107107
Analytics.prototype.addSourceMiddleware = function(middleware) {
108-
if (this.initialized)
109-
throw new Error(
110-
'attempted to add a source middleware after initialization'
111-
);
112-
113108
this._sourceMiddlewares.add(middleware);
114109
return this;
115110
};
@@ -122,11 +117,6 @@ Analytics.prototype.addSourceMiddleware = function(middleware) {
122117
*/
123118

124119
Analytics.prototype.addIntegrationMiddleware = function(middleware) {
125-
if (this.initialized)
126-
throw new Error(
127-
'attempted to add an integration middleware after initialization'
128-
);
129-
130120
this._integrationMiddlewares.add(middleware);
131121
return this;
132122
};

0 commit comments

Comments
 (0)