{"size": 555, "ext": "js", "max_stars_repo_path": "tools/demo/pages/index/comp/index.js", "max_stars_repo_name": "jingyue0828/stateful-minapp", "max_stars_repo_stars_event_min_datetime": "2020-11-15T15:04:34.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-15T15:04:34.000Z", "max_issues_repo_path": "tools/demo/pages/index/comp/index.js", "max_issues_repo_name": "jingyue0828/stateful-minapp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tools/demo/pages/index/comp/index.js", "max_forks_repo_name": "jingyue0828/stateful-minapp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.8214285714, "max_line_length": 63, "alphanum_fraction": 0.581981982}
import { connectComponent } from '../../../lib/minapp-rct';
import { actions } from '../../../store/index';

const component = {
  state(state) {
    return {
      userName: state.user.userInfo.userName,
    };
  },
  data: {
    testThis: '123',
  },
  actions(dispatch, state) {
    return {
      updateUserName(name) {
        dispatch(actions.user.setUserInfo({ userName: name }));
      },
    };
  },
  methods: {
    updateUserNameByComp() {
      this.updateUserName('isComponentName');
    },
  },
};

Component(connectComponent()(component));
