8 Commits

Author SHA1 Message Date
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
8f8c3b6c9c Refactor action definitions to type less 2019-03-22 13:26:58 +08:00
f2e44f477c Add better type checking when connecting components 2019-03-20 16:57:41 +05:00
0fcd8cbb03 Move login logic into a single folder 2019-01-20 00:48:22 +01:00
26f106fcae Create LoginForm 2019-01-19 19:21:56 +01:00
c1c7c829e7 Add support for error actions 2019-01-19 17:39:54 +01:00
eedd57c527 Add ability to easily create unions of action types 2019-01-19 15:23:51 +01:00