8 Commits

Author SHA1 Message Date
264f5aba60 Add T prefix for all type defs 2019-04-02 16:22:38 +08:00
580fb368e6 Simplify types for CRUDActions & CRUDReducer 2019-04-02 11:44:34 +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
003bccc9e8 projects/node: Add custom redirectTo after successful login 2019-03-18 13:13:52 +05:00
5a34885605 Add withForm HOC, as well as RegisterForm 2019-03-17 15:05:02 +05:00
bdf0aa57be Add TestUtils and a generic way to isolate connected components 2019-01-20 18:11:18 +01:00
0fcd8cbb03 Move login logic into a single folder 2019-01-20 00:48:22 +01:00