@iterable/react-native-sdk
Version:
Iterable SDK for React Native.
42 lines (37 loc) • 1.21 kB
JavaScript
;
/**
* IterableAction represents an action defined as a response to user events.
*
* It is currently used in push notification actions (open push & action buttons).
*/
export class IterableAction {
/** The type of iterable action. */
/**
* Determines the action. EG: "open_url", "open_in_app", "deep_link", "join" etc.
*/
/**
* Additional info related to the action.
*/
/**
* Creates an instance of IterableAction.
*
* @param type - The type of the action.
* @param data - Optional data associated with the action.
* @param userInput - Optional user input related to the action.
*/
constructor(type, data, userInput) {
this.type = type;
this.data = data;
this.userInput = userInput;
}
/**
* Creates an instance of `IterableAction` from a dictionary object.
*
* @param dict - The dictionary object containing the properties to initialize the `IterableAction` instance.
* @returns A new instance of `IterableAction` initialized with the provided dictionary properties.
*/
static fromDict(dict) {
return new IterableAction(dict.type, dict.data, dict.userInput);
}
}
//# sourceMappingURL=IterableAction.js.map