Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Epics

Module for redux-observable Epics of the Sense/Net 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 Sense/Net'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 Sense/Net 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 Sense/Nets 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: updateContentEpic = combineEpics(fetchContentEpic,createContentEpic,updateContentEpic,deleteContentEpic,deleteBatchEpic,checkoutContentEpic,checkinContentEpic,publishContentEpic,approveContentEpic,rejectContentEpic,undocheckoutContentEpic,forceundocheckoutContentEpic,restoreversionContentEpic,userLoginEpic,userLogoutEpic)

sn-redux root Epic, the main Epic combination that is used on a default Sense/Net application. Contains Epics related to CRUD operations and thr other built-in Sense/Net 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

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

createContentEpic

  • createContentEpic(action$: 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

    Returns any

deleteBatchEpic

  • deleteBatchEpic(action$: any, store: any): 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

    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): 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

    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

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

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

userLoginEpic

  • userLoginEpic(action$: any, store: any): any
  • Epic to login a user to a Sense/Net 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

    Returns any

userLogoutEpic

  • userLogoutEpic(action$: any, store: any): any
  • Epic to logout a user from a Sense/Net 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

    Returns any

Generated using TypeDoc