import { IModel , IHubRequestOptions , getProp } from "@esri/hub-common" ; import { fetchDraft } from "./fetch-draft" ; import { applyDraft } from "./apply-draft" ; param { * } siteOrPageModel param { * } hubRequestOptions export function fetchAndApplyDraft ( siteOrPageModel , hubRequestOptions ) { return fetchDraft ( getProp ( siteOrPageModel , "item.id" ) , hubRequestOptions ) . then ( draft => applyDraft ( siteOrPageModel , draft ) ) ; }