Skip to content

Commit

Permalink
documentation improvements #265
Browse files Browse the repository at this point in the history
  • Loading branch information
remmeier committed May 10, 2018
1 parent 1c7de2f commit f2f0e7d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions docs/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The following actions are used in NgrxJsonApi:
| API_DELETE_INIT | Issues a `DELETE` request for a resource. |
| API_DELETE_SUCCESS | Upon success completion of a `DELETE` request. |
| API_DELETE_FAIL | Upon a failure of a `DELETE` request. |
| API_APPLY_INIT | Initiates the appropriate API_X_INIT action for all pending local modifications. |
| API_APPLY_INIT | Initiates the appropriate API_X_INIT action for all pending local modifications except resources in state `NEW`. |
| API_APPLY_SUCCESS | Upon success completion of all requested modifications. |
| API_APPLY_FAIL | Upon failure a at least one requested modification. |
| API_ROLLBACK: | Reverts all local changes to resources in the store. |
Expand All @@ -29,8 +29,11 @@ The following actions are used in NgrxJsonApi:
| LOCAL_QUERY_FAIL | Triggered when a local query failed. |
| DELETE_STORE_RESOURCE | Marks a resource in the store for deletion. Does not trigger an update to the server. |
| PATCH_STORE_RESOURCE | Patches a resource in the store by merging the provided values with the ones from the store. Does not trigger an update to the server. |
| POST_STORE_RESOURCE | Adds a new resource to the store. Does not trigger an update to the server. |
| POST_STORE_RESOURCE | Adds a new resource to the store. Does not trigger an update to the server. The resource then carries the state `CREATED`. |
| NEW_STORE_RESOURCE | Adds a new resource to the store that is not yet considered being ready to be posted to the server. The resource then carries the state `NEW` rather than `CREATED`. |
| MODIFY_STORE_RESOURCE_ERRORS | Modifies the errors of a resource in the store. Use for client side validation. |
| REMOVE_QUERY | Removes a query from the store. |
| COMPACT_STORE | Removes all resources from the store that are not directly or indirectly (relationships) references from a query |
| CLEAR_STORE | Removes all the contents from the store

More information are available in [actions.ts](../src/actions.ts).
2 changes: 1 addition & 1 deletion docs/advanced_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ or indirectly (relationships) by a query.
`QueryParams` object hold by a query allows to specify various `GET` parameters:

```ts
let zone = this.ngrxJsonApiService.getZone(NGRX_JSON_API_DEFAULT_ZONE);
let zone = this.ngrxService.getZone(NGRX_JSON_API_DEFAULT_ZONE);

const query: Query = {
queryId: 'myQuery',
Expand Down
10 changes: 5 additions & 5 deletions docs/service_overview.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## Services

There is one service available: `NgrxJsonApiService`. It holds two main methods both returning a `NgrxJsonApiZoneService` instance:
There is one service available: `NgrxJsonApiService`. It holds methods for:

- `getZone(zoneId: string)`
- `getDefaultZone`
- `getZone(zoneId: string)` to obtain the zone with the specified `zoneId`.
- `getDefaultZone` to obtain the `default` zone.
- All methods of `NgrxJsonApiZoneService` for the `default` zone as short-cut to avoid `getDefaultZone()`.

`NgrxJsonApiZoneService` holds utility methods to interact with the store: do selections and trigger actions:

Expand All @@ -29,5 +30,4 @@ There is one service available: `NgrxJsonApiService`. It holds two main methods
- `addResourceErrors`, `removeResourceErrors()` and `setResourceErrors()` to modify the `errors` of a `StoreResource`


More information are available in https://github.com/abdulhaq-e/ngrx-json-api/blob/master/src/services.ts. The
actions are available in https://github.com/abdulhaq-e/ngrx-json-api/blob/master/src/actions.ts.
More information are available in https://github.com/abdulhaq-e/ngrx-json-api/blob/master/src/services.ts.

0 comments on commit f2f0e7d

Please sign in to comment.