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

精读《React Conf 2019 - Day2》 #217

Closed
ascoders opened this issue Nov 11, 2019 · 1 comment
Closed

精读《React Conf 2019 - Day2》 #217

ascoders opened this issue Nov 11, 2019 · 1 comment

Comments

@ascoders
Copy link
Owner

ascoders commented Nov 11, 2019

React Conf 2019 于 2019.10.23 号开始,信息量很大:视频链接

本周精读介绍第二天的内容并结合笔者自身思考,拭目以待~


精读《React Conf 2019 - Day2》

@Sliect
Copy link

Sliect commented Sep 3, 2020

函数式编程里的例子应该是这个意思

const Store = ({ state, render }) => ({
    state,
    render,
    extend: (f) =>
      Store({ state, render: (state) => f(Store({ state, render })) }),
    extract: () =>  render(state),
  });

  const App = Store({
    state: { msg: "World" },
    render: ({ msg }) => <p>Hello {msg}</p>,
  });

  App.extend(({ state, render }) =>
    render(state.msg === "World" ? { msg: "ReactConf" } : state)
  ).extract();

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

No branches or pull requests

2 participants