|
3 | 3 | */ |
4 | 4 |
|
5 | 5 | import { |
| 6 | + ACTION_DELETE_TYPE_NAME, |
6 | 7 | ACTION_EMPTY_TYPE_NAME, |
7 | | - ACTION_CLEAN_TYPE_NAME, |
8 | 8 | ACTION_ID_KEY, |
9 | 9 | ACTION_IDS_KEY, |
10 | 10 | ACTION_TYPE_PREFIX, |
@@ -447,28 +447,31 @@ const makeAction = function( |
447 | 447 | } |
448 | 448 | } |
449 | 449 |
|
450 | | - // /** |
451 | | - // * Clean entity from entity reducer |
452 | | - // * |
453 | | - // * @memberOf action.makeAction.Action |
454 | | - // * @type {Function} |
455 | | - // * |
456 | | - // * @example |
457 | | - // * store.dispatch(userLoginAction.clean()) |
458 | | - // * |
459 | | - // * @returns {Undefined} - returns None, only clear entity data |
460 | | - // */ |
461 | | - // this.action.clean = () => { |
462 | | - // return (dispatch, getState) => { |
463 | | - // dispatch({ |
464 | | - // time: new Date().getTime(), |
465 | | - // type: ACTION_CLEAN_TYPE_NAME, |
466 | | - // prefix: ACTION_TYPE_PREFIX, |
467 | | - // actionId: this.actionId, |
468 | | - // actionSchema: this.schema |
469 | | - // }) |
470 | | - // } |
471 | | - // } |
| 450 | + /** |
| 451 | + * Delete entity from entity reducer |
| 452 | + * |
| 453 | + * @memberOf action.makeAction.Action |
| 454 | + * @type {Function} |
| 455 | + * |
| 456 | + * @example |
| 457 | + * store.dispatch(userDeleteAction.delete()) |
| 458 | + * |
| 459 | + * @example |
| 460 | + * store.dispatch(userDeleteAction.withPrefix(userId).delete()) |
| 461 | + * |
| 462 | + * @returns {Undefined} - returns None, only delete entity data |
| 463 | + */ |
| 464 | + this.action.delete = () => { |
| 465 | + return (dispatch, getState) => { |
| 466 | + dispatch({ |
| 467 | + time: new Date().getTime(), |
| 468 | + type: ACTION_DELETE_TYPE_NAME, |
| 469 | + prefix: ACTION_TYPE_PREFIX, |
| 470 | + actionId: this.actionId, |
| 471 | + actionSchema: this.schema |
| 472 | + }) |
| 473 | + } |
| 474 | + } |
472 | 475 |
|
473 | 476 | return this.action |
474 | 477 | } |
|
0 commit comments