Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Epics

Module for redux-observable Epics of the sensenet built-in OData actions.

An Epic is the core primitive of redux-observable. It is a function which takes a stream of actions and returns a stream of actions.

Learn more about redux-observable Epics here;

In sensenet's case it means that the action steps (for exmaple request, success, fail) or multiple actions can be combined into Epics. It's extremely useful if you have to work with async action or you have a complex process with multiple steps that have to wait for each other like validation, multiple step saving, etc.

Following epics cover the CRUD operations and all the other built-in sensenet OData Actions. All of these Epics are combined into one root Epic. If you want to use them in your application without any customization you don't have to do anything special, because it is set as default at the store creation, but if you want add you custom Epics to it use combineEpics on sensenets root Epic and yours.

import { combineEpics } from 'redux-observable';
import { myCombinedEpics } from '../myApp/Epics';
import { myRootReducer } from '../myApp/Reducers';
import { rootEpic } from '../sn-redux/Epics';

const myRootEpic = combinedEpics(
 rootEpic,
 myCombinedEpics
);

const store = Store.configureStore(myRootReducer, myRootEpic, [Authentication]);

Index

Variables

rootEpic

rootEpic: uploadFileEpic = combineEpics(initSensenetStoreEpic,fetchContentEpic,loadContentEpic,loadContentActionsEpic,createContentEpic,updateContentEpic,deleteContentEpic,deleteBatchEpic,copyBatchEpic,moveBatchEpic,checkoutContentEpic,checkinContentEpic,publishContentEpic,approveContentEpic,rejectContentEpic,undocheckoutContentEpic,forceundocheckoutContentEpic,restoreversionContentEpic,userLoginEpic,userLogoutEpic,checkLoginStateEpic,getContentActions,uploadFileEpic)

sn-redux root Epic, the main Epic combination that is used on a default sensenet application. Contains Epics related to CRUD operations and thr other built-in sensenet OData Actions and Function.

Functions

approveContentEpic

  • approveContentEpic(action$: any, store: any): any
  • Epic to approve a Content in the Content Repository. It is related to three redux actions, returns Approve action and sends the response to the ApproveSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ApproveFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

checkLoginStateEpic

  • checkLoginStateEpic(action$: any, store: any, dependencies?: object): any
  • Epic to wait for the current login state to be initialized

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

checkinContentEpic

  • checkinContentEpic(action$: any, store: any): any
  • Epic to checkin a Content in the Content Repository. It is related to three redux actions, returns CheckIn action and sends the response to the CheckInSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the CheckInFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

checkoutContentEpic

  • checkoutContentEpic(action$: any, store: any): any
  • Epic to checkout a Content in the Content Repository. It is related to three redux actions, returns CheckOut action and sends the response to the CheckOutSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the CheckOutFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

copyBatchEpic

  • copyBatchEpic(action$: any, store: any, dependencies?: object): any
  • Epic to copy multiple Content in the Content Repository. It is related to three redux actions, returns CopyBatch action and sends the response to the CopyBatchSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the CopyBatchFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

createContentEpic

  • createContentEpic(action$: any, store: any): any
  • Epic for creating a Content in the Content Repository. It is related to three redux actions, returns CreateContent action and sends the JSON response to the CreateContentSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the CreateContentFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

deleteBatchEpic

  • deleteBatchEpic(action$: any, store: any, dependencies?: object): any
  • Epic to delete multiple Content from the Content Repository. It is related to three redux actions, returns DeleteBatch action and sends the response to the DeleteBatchSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the DeleteBatchFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

deleteContentEpic

  • deleteContentEpic(action$: any, store: any): any
  • Epic to delete a Content from the Content Repository. It is related to three redux actions, returns Delete action and sends the response to the DeleteSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the DeleteFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

fetchContentEpic

  • fetchContentEpic(action$: any, store: any, dependencies?: object): any
  • Epic for fetching content from the Content Repository. It is related to three redux actions, returns the RequestContent action and sends the JSON response to the ReceiveContent action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ReceiveContentFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

forceundocheckoutContentEpic

  • forceundocheckoutContentEpic(action$: any, store: any): any
  • Epic to force undo checkout a Content in the Content Repository. It is related to three redux actions, returns ForceUndoCheckout action and sends the response to the ForceUndoCheckoutSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ForceUndoCheckoutFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

getContentActions

  • getContentActions(action$: any, store: any, dependencies?: object): any
  • Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

initSensenetStoreEpic

  • initSensenetStoreEpic(action$: any, store: any, dependencies?: object): any
  • Epic for initialize a sensenet Redux store. It checks the InitSensenetStore Action and calls the necessary ones snycronously. Loads the current content, checks the login state with CheckLoginState, fetch the children items with RequestContent and loads the current content related actions with LoadContentActions.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

loadContentActionsEpic

  • loadContentActionsEpic(action$: any, store: any, dependencies?: object): any
  • Epic for loading Actions of a content from the Content Repository. It is related to three redux actions, returns the LoadContentActions action and sends the JSON response to the ReceiveContentActions action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ReceiveContentActionsFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

loadContentEpic

  • loadContentEpic(action$: any, store: any, dependencies?: object): any
  • Epic for loading content from the Content Repository. It is related to three redux actions, returns the LoadContent action and sends the JSON response to the ReceiveLoadedContent action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ReceiveLoadedContentFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

moveBatchEpic

  • moveBatchEpic(action$: any, store: any, dependencies?: object): any
  • Epic to move multiple Content in the Content Repository. It is related to three redux actions, returns MoveBatch action and sends the response to the MoveBatchSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the MoveBatchFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

publishContentEpic

  • publishContentEpic(action$: any, store: any): any
  • Epic to publish a Content in the Content Repository. It is related to three redux actions, returns Publish action and sends the response to the PublishSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the PublishFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

rejectContentEpic

  • rejectContentEpic(action$: any, store: any): any
  • Epic to reject a Content in the Content Repository. It is related to three redux actions, returns Reject action and sends the response to the RejectSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the RejectFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

reloadContentEpic

  • reloadContentEpic(action$: any, store: any): any
  • Epic for reloading content from the Content Repository. It is related to three redux actions, returns the ReloadContent action and sends the JSON response to the ReceiveReloadedContent action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ReceiveReloadedContentFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

reloadContentFieldsEpic

  • reloadContentFieldsEpic(action$: any, store: any): any
  • Epic for reloading fields of a content from the Content Repository. It is related to three redux actions, returns the ReloadContentFields action and sends the JSON response to the ReceiveReloadedContentFields action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ReceiveReloadedContentFieldsFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

restoreversionContentEpic

  • restoreversionContentEpic(action$: any, store: any): any
  • Epic to restore a version of a Content in the Content Repository. It is related to three redux actions, returns RestoreVersion action and sends the response to the RestoreVersionSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the RestoreVersionFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

undocheckoutContentEpic

  • undocheckoutContentEpic(action$: any, store: any): any
  • Epic to undo checkout a Content in the Content Repository. It is related to three redux actions, returns UndoCheckout action and sends the response to the UndoCheckoutSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the UndoCheckoutFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

updateContentEpic

  • updateContentEpic(action$: any, store: any): any
  • Epic for updating metadata of a Content in the Content Repository. It is related to three redux actions, returns UpdateContent action and sends the JSON response to the UpdateContentSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the UpdateContentFailure action.

    Parameters

    • action$: any
    • store: any

    Returns any

uploadFileEpic

  • uploadFileEpic(action$: any, store: any, dependencies?: object): any
  • Epic to upload a file to the Content Repository. It is related to three redux actions, returns UploadContent action and sends the response to the UploadSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the UploadFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

userLoginBufferEpic

  • userLoginBufferEpic(action$: any, store: any, dependencies?: object): any
  • Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

userLoginEpic

  • userLoginEpic(action$: any, store: any, dependencies?: object): any
  • Epic to login a user to a sensenet portal. It is related to three redux actions, returns LoginUser action and sends the response to the LoginUserSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the LoginUserFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

userLogoutEpic

  • userLogoutEpic(action$: any, store: any, dependencies?: object): any
  • Epic to logout a user from a sensenet portal. It is related to three redux actions, returns LogoutUser action and sends the response to the LogoutUserSuccess action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the LogoutUserFailure action.

    Parameters

    • action$: any
    • store: any
    • Optional dependencies: object
      • repository: BaseRepository

    Returns any

Generated using TypeDoc