React Reflux Store state 값 가져오기 Data Flow
// Component
class Plans extends React.Component {
  constructor(props){
    super(props);
    this.state = {
      params: props.params
    };
  }
  render() {
    return (
      <div className="plan-list-container">
        <PlanList { ...this.state } />
      </div>
    );
  }
}// PlanList Component
class PlanList extends React.Component {
  constructor(props){
    super(props);
    this.state = {
      page_loading: false
    };
    PlanActions.setParams(props.params);
  }// PlanActions
var PlanActions = Reflux.createActions([
  'setParams',
  'loadPlans',
  'loadPlansSuccess'
]);
PlanActions.loadPlans.preEmit = function(){
  PlanActions.loadPlansSuccess();
};// Store
var PlanStore = Reflux.createStore({
  init() {
    this.listenToMany(PlanActions);
  },
  setParams(params) {
    this.params = params;
  },
  loadPlans() {
    this.trigger({ 
      loading: true
    });
  },
  loadPlansSuccess() {
    $.ajax({
        url: this.ajaxApi,
        dataType: 'json',
        data: {
          sku: this.params.sku
        },
        cache: true,
        success: function(data) {이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
AngularJs $scope 기능 및 Filter 공통점우선 우리는 이러한 실례를 본다. 인스턴스 사용: (Works good) 다른 예: (Html 삽입, It doesn't work, WHY?) 발상 전환: (Work perfect)...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.