コード例 #1
0
ファイル: index.js プロジェクト: facebook/css-layout
  modifyAtPath(
    path: Array<any>,
    value: any,
    selectedNodePath?: ?Array<number> = this.state.selectedNodePath,
  ) {
    // $FlowFixMe
    const layoutDefinition = setIn(this.state.layoutDefinition, path, value);
    this.setState({
      layoutDefinition,
      selectedNodePath,
    });

    if (this.props.persist) {
      window.history.replaceState(
        {},
        null,
        window.location.origin +
          window.location.pathname +
          '?' +
          this.getHash(layoutDefinition),
      );
    }
  }
コード例 #2
0
ファイル: UserStore.js プロジェクト: cdebotton/isojs
function updateUser(id, user) {
  var index = _payload.get('entities')
    .findIndex(entity => entity._id === user._id);

  _payload = _payload.setIn(['entities', index], user);
}