5 Commits

Author SHA1 Message Date
eebe26f706 Extract redux, http-types, http-client and test-utils 2019-09-10 17:56:25 +07:00
3660540451 Add HistoryCrumbs.tsx 2019-04-04 10:50:33 +08:00
264f5aba60 Add T prefix for all type defs 2019-04-02 16:22:38 +08:00
8b6f90235e Use default action type and add status to async actions
Since TypeScript can infer types based on string types, it has became
easier to define a single constant of an action that returns a promise,
and then dispatch actions with different statuses: pending, resolved,
and/or rejected. This seems like more typing at first, but in the long
run it will become easier to write generic reducer methods, and the
names of reduced types will not have to be repeated every time.

For example, previously we had to write:

    type MyActionTypes =
      IAsyncAction<IUser, 'LOGIN_PENDING', 'LOGIN_RESOLVED', 'LOGIN_REJECTED'>
      | ...

And now we can write:

    type MyActionTypes =
      IAsyncAction<IUser, 'LOGIN'>
      | ...
2019-04-01 15:20:42 +08:00
d3f294a57c Add packages/client/src/crumbs 2019-03-25 18:30:32 +08:00