-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Error when calling imitate multiple times #138
Comments
Imitate only exists to enable circular dependencies. It's unfortunately an imperative API, and I think it shouldn't be able to call it multiple times because then we're allowing dynamic circular dependencies, and this starts to get confusing very fast. We could make it through an error in that case, but it would only add more code to the bundle. Let's keep in the list as an idea. |
Don't get me wrong, I know you care much about resulting bundle "size", but this issue: adds much more to current cycle bundles then potential couple lines of code that can make things safer 😉 |
I agree, and I'm still up for accepting a PR for that issue. The difference is that xstream is a much more foundational library than Cycle DOM. xstream is a dependency everywhere in Cycle.js, so its bundle size is more important. |
I think it (makeHTMLDriver) should be properly be extracted and documented maybe @TylorS could accomplish it. If no one will, I will someday 😄
In most real cases it is supposed to be included only once per bundle, so it is not more important then any other component's size (esp dom driver for front-end web apps). |
I didn't mean it would be included multiple times. I meant it will always be included, so it will determine the minimum size of any Cycle.js app. But anyway, we are not in disagreement. |
I wonder how
imitate
called multiple times should behave. Or it should be allowed to be called only once with an error thrown for example.http://www.webpackbin.com/4kKOgnNxM
Though it could be interesting to allow multiple times imitate call with proper unsubscribing from previous source.
The text was updated successfully, but these errors were encountered: