unistore icon indicating copy to clipboard operation
unistore copied to clipboard

skatejs support

Open silenceisgolden opened this issue 8 years ago • 1 comments

Just tried to take a stab at adding support for https://github.com/skatejs/skatejs but ran into a few issues:

  1. 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.
  2. 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!

silenceisgolden avatar Jan 30 '18 02:01 silenceisgolden

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.

developit avatar Apr 27 '18 02:04 developit