Skip to content
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

Marty.Component #147

Merged
merged 11 commits into from
Mar 1, 2015
Merged

Marty.Component #147

merged 11 commits into from
Mar 1, 2015

Conversation

jhollingworth
Copy link
Contributor

Now that mixins are being removed from React (For classes at least) we need a replacement for the state mixin that works well with ES6 classes. Current thinking is we create Marty.Component which is a drop in replacement for React.Component that plays a similar role (albeit with a smaller feature set).

class FooComponent extends Marty.Component {
  constructor(props) {
    super(props);
    this.listenTo = FooStore;
  }
  render() {
    return <div>{this.state.foo}</div>
  }
  getState() {
    return {
      foo: FooStore.getFoo(123)
    }
  }
}

Todo

  • Listen to stores
  • Refactor code to share with state mixin?
  • Replace Diagnostics#trace with logger#trace
  • Use React contexts to pass the current Marty context down to components
    • ES5
    • ES6
  • Documentation

@jhollingworth jhollingworth mentioned this pull request Feb 26, 2015
50 tasks
jhollingworth added a commit that referenced this pull request Mar 1, 2015
@jhollingworth jhollingworth merged commit db59573 into v0.9 Mar 1, 2015
@jhollingworth jhollingworth deleted the component branch March 1, 2015 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant