10 Commits

Author SHA1 Message Date
0630260628 Add space-within-parens rule 2019-04-02 15:09:47 +08:00
b8ff27128b Make query optional 2019-04-02 14:38:11 +08:00
2f17418753 Simplify CRUDReducer methods 2019-04-02 12:03: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
31bb2aa5ee Make CRUDActions method bound 2019-04-01 13:11:43 +08:00
73be64a900 Add packages/client/src/crud 2019-04-01 12:56:31 +08:00
eed79f35f2 Add start of test for crud 2019-03-28 19:35:09 +08:00
d6113b2fc4 Add CRUDActions 2019-03-28 00:16:14 +08:00
32b527d92f Add CRUDReducer 2019-03-27 19:10:35 +08:00