-
Notifications
You must be signed in to change notification settings - Fork 539
Reimplement custom element example #49
base: master
Are you sure you want to change the base?
Conversation
Refactor custom element example to conform to the newest versions of rxmarbles components. Add ES5 custom web component shim, since source code for rxmarbles clasess is compiled to ES5. Update webpack config to compile new custom element source file into distribution folder. Related to staltz#48.
src/element.js
Outdated
const sandbox = Sandbox( sources ); | ||
const sinks = { | ||
DOM: sandbox.DOM, | ||
store: Observable.merge( sandbox.data ).scan(merge, { route: key, inputs: undefined }), |
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.
We don't need this static .merge()
anymore. I'll fix this.
@xtianjohns Good to see this. :) |
Single source streams don't need to be merged.
Cool, we'll leave the shim in the example for other folks to include as they need. I fixed up the problems I spotted, and we can push docs off until later then! Should be ready to review/merge whatever. |
When trying to view test-custom-element.html, I get a blank browser page. |
Hrm, @nadavwr you're not doing anything wrong, I can see the same behavior with |
Fix issue where sandbox skips first emission from sources. Initialize store with stream that emits values in both sources/sinks to get a double emission.
Okay, this should be working again. I don't know why this problem was happening, it could have been a missing polyfill (which I've now included) that caused a white screen on Firefox, or it could have been due to a At least, I think that's why the Sandbox component never rendered - because it never sees an emission from the store and so it stays silent. @staltz if you get time to review tomorrow, my fix was to add two |
Hi @xtianjohns :) We're just missing the |
Refactor custom element example to conform to the newest versions of
rxmarbles
components. Add ES5 custom web component shim to example HTML file. Update webpack config to compile new custom element source file into distribution folder.Related to #48.
There's outstanding work here relating to how we document this and how or if we want to bundle the shim. I'm open to feedback about this, I've not thought about it much yet.