unistore
unistore copied to clipboard
skatejs support
Just tried to take a stab at adding support for https://github.com/skatejs/skatejs but ran into a few issues:
- Jest seems to not be friendly with custom elements since you cannot extend HTMLElement. I see https://github.com/jsdom/webidl2js/pull/88 and https://github.com/jsdom/jsdom/issues/1030 that have no positive resolution and require fundamental changes in jsdom.
- What should an example of using unistore with a skatejs component look like? My current assumption is something like:
import { withComponent } from 'skatejs';
import { connect } from 'unistore/skatejs';
const actions = store => ({
// ...
});
class TestComponent extends connect('count', actions, withComponent()) {
render({ count }) {
return `Count is ${count}`;
}
}
Thoughts?
Thanks!
Only way to combat the Jest/JSDOM issue would be to switch to a browser for tests - we could switch to karmatic without changing much.
Does Skate support component composition? I wouldn't normally push connect() into a mixin like that, but maybe that's more idiomatic for Skate.