Skip to content
Next Next commit
Create popToParent Action
  • Loading branch information
rseemann committed Jun 8, 2016
commit 7a09760727dedd3bda1962cdd2cddc98ce28b15b
6 changes: 6 additions & 0 deletions src/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const PUSH_ACTION = 'push';
export const REPLACE_ACTION = 'replace';
export const POP_ACTION2 = 'back';
export const POP_ACTION = 'BackAction';
export const POP_TO_PARENT_ACTION = 'popToParent';
export const REFRESH_ACTION = 'refresh';
export const RESET_ACTION = 'reset';
export const FOCUS_ACTION = 'focus';
Expand All @@ -32,6 +33,7 @@ function filterParam(data) {
const reservedKeys = [
POP_ACTION,
POP_ACTION2,
POP_TO_PARENT_ACTION,
REFRESH_ACTION,
REPLACE_ACTION,
JUMP_ACTION,
Expand Down Expand Up @@ -150,6 +152,10 @@ class Actions {
return res;
}

popToParent(props = {}) {
return this.callback({ ...filterParam(props), type: POP_TO_PARENT_ACTION });
}

pop(props = {}) {
return this.callback({ ...filterParam(props), type: POP_ACTION });
}
Expand Down