showmethecode icon indicating copy to clipboard operation
showmethecode copied to clipboard

#TW Meetup #2 20190520

Open debuggingfuture opened this issue 5 years ago • 10 comments

日期 Date

20190520

地點 Location

  • Taiwan

場地 Venue

  • AppWorks 4/F

題目 Sessions

  • in <> @<<speaker>> , with one-line to describe</speaker>

debuggingfuture avatar Mar 24 '19 16:03 debuggingfuture

@vincentlaucy will share on yarn workspaces & monorepo setup https://medium.com/wordquest-engineering/structuring-js-app-in-monorepo-yarn-workspaces-react-node-firebase-845e207a4314 @alincode will share writing more functional code in javascript

debuggingfuture avatar Mar 24 '19 16:03 debuggingfuture

收 React Hooks 的演講嗎?我有一些奇怪的 hooks 可以講,但還沒寫投影片😂

caasi avatar May 12 '19 17:05 caasi

@caasi sure! 非常歡迎而且不需要投影片,我們直接show code 😂

debuggingfuture avatar May 13 '19 10:05 debuggingfuture

直接秀 code !那麼歡樂!好喔。

目前寫到一半的在: https://caasih.net/playground/useless, source

caasi avatar May 13 '19 17:05 caasi

@vincentlaucy I would going to share seo solution when use Material-ui in nextjs

dreamline2 avatar May 14 '19 09:05 dreamline2

Hello, I'm Lego.

Here is the code I shared yesterday.

Thanks, everyone. Such a nice place! :)

qas612820704 avatar May 21 '19 03:05 qas612820704

https://github.com/alincode/20190520-show-me-the-code by @alincode

debuggingfuture avatar May 21 '19 08:05 debuggingfuture

@qas612820704:

Your talk reminds me that we can treat actions as messages in OOP.

caasi avatar May 21 '19 16:05 caasi

@caasi, can you tell me in detail? :)

qas612820704 avatar May 22 '19 09:05 qas612820704

A simplified User class:

class User {
  constructor(name) {
    this.name = name;
  }

  name(v) {
    this.name = v;
    return this;
  }
}

An User reducer:

const USER_NAME = 'USER_NAME';

const Name = (name) => ({
  type: USER_NAME,
  name,
});

const initialState = {
  name: '',
};

const reducer = (state = initialState, action = {}) {
  switch(action.type) {
    case USER_NAME: {
      const { name } = action;
      return { ...state, name };
    }
    default:
      return state;
  }
}

Their structure are almost the same. So if you dispatch actions by yourself, you can reuse reducers in any reducer. Just like you can delegate messages(call methods) to other objects in OOP paradigm.

caasi avatar May 22 '19 10:05 caasi