UNPKG

@ima/core

Version:

IMA.js framework for isomorphic javascript application

65 lines (64 loc) 1.81 kB
/** * Manager of the current page state and state history. */ export class PageStateManager { onChange; /** * Clears the state history. */ clear() { return; } /** * Sets a new page state by applying the provided patch to the current * state. * * @param statePatch The patch of the current state. */ setState(patchState) { return; } /** * Returns the current page state. * * @return The current page state. */ getState() { return {}; } /** * Returns the recorded history of page states. The states will be * chronologically sorted from the oldest to the newest. * * Note that the implementation may limit the size of the recorded history, * therefore the complete history may not be available. * * @return The recorded history of page states. */ getAllStates() { return []; } /** * Returns queueing state patches off the main state from the begin of transaction. * * @return State patches from the begin of transaction. */ getTransactionStatePatches() { return []; } /** * Starts queueing state patches off the main state. While the transaction * is active every `setState` call has no effect on the current state. * * Note that call to `getState` after the transaction has begun will * return state as it was before the transaction. */ beginTransaction() { return; } /** * Applies queued state patches to the main state. All patches are squashed * and applied with one `setState` call. */ commitTransaction() { return; } /** * Cancels ongoing transaction. Uncommitted state changes are lost. */ cancelTransaction() { return; } } //# sourceMappingURL=PageStateManager.js.map