Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Reducers

Module for defining Redux reducers.

Actions describe the fact that something happened, but don't specify how the application's state changes in response. This is the job of a reducer.

Following module contains the reducers of sn-redux, some 'reducer groups' and the root reducer which could be passed to the store creator function. Using a root reduces means that you define which combination of reducers will be used and eventually defines which type of actions can be called on the store.

Index

Variables

batchResponses

batchResponses: function = combineReducers({response: OdataBatchResponse,error: batchResponseError})

Reducer combining response and error into a single object, batchResponses.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

children

children: function = combineReducers({ids,entities,isFetching,error: childrenerror,actions: childrenactions,top,skip,query,order,filter,select,isOpened})

Reducer combining ids, entities, isFetching, error, top, skip, query, order, filter and select into a single object, children.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

contentState

contentState: function = combineReducers({isSaved,isValid,isDirty,isOperationInProgress})

Reducer combining isSaved, isValid, isDirty and isOperationInProgress into a single object, contentState.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

currentcontent

currentcontent: function = combineReducers({contentState,error: contenterror,actions: contentactions,fields,content})

Reducer combining contentState, error, actions, fields and content into a single object, currentcontent.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

selected

selected: function = combineReducers({ids: selectedIds,entities: selectedContentItems})

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

sensenet

sensenet: function = combineReducers({session,children,currentcontent,selected,batchResponses})

Reducer combining session, children, currentcontent and selected into a single object, sensenet which will be the top-level one.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

session

session: function = combineReducers({country,language,loginState,error: loginError,user,repository})

Reducer combining country, language, loginState, error and user into a single object, session.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

user

user: function = combineReducers({userName,fullName,userLanguage,userAvatarPath})

Reducer combining userName, fullName, userLanguage, userAvatarPath into a single object, user.

Type declaration

    • (state: S, action: AnyAction): S
    • Parameters

      • state: S
      • action: AnyAction

      Returns S

Functions

OdataBatchResponse

  • OdataBatchResponse(state?: ObjectConstructor, action: any): any
  • Reducer to handle Actions on the OdataBatchResponse Object.

    Parameters

    • Default value state: ObjectConstructor = Object

      Represents the current state.

    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

batchResponseError

  • batchResponseError(state?: string, action: any): any
  • Reducer to handle Actions on the batchResponseError Object.

    Parameters

    • Default value state: string = ""

      Represents the current state.

    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

childrenactions

  • childrenactions(state?: any[], action: any): any
  • Reducer to handle Actions on the chidlrenactions object in the children object.

    Parameters

    • Default value state: any[] = []
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

childrenerror

  • childrenerror(state?: any, action: any): any
  • Reducer to handle Actions on the childrenerror property in the children object.

    Parameters

    • Default value state: any = null
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

content

  • content(state?: object, action: any): any
  • Reducer to handle Actions on the content object in the currentcontent object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

contentactions

  • contentactions(state?: object, action: any): any
  • Reducer to handle Actions on the contentactions object in the currentcontent object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

contenterror

  • contenterror(state?: any, action: any): any
  • Reducer to handle Actions on the contenterror property in the currentcontent object.

    Parameters

    • Default value state: any = null
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

country

  • country(state?: string, action: any): string
  • Reducer to handle Actions on the country property in the session object.

    Parameters

    • Default value state: string = ""
    • action: any

      Represents an action that is called.

    Returns string

    state. Returns the next state based on the action.

entities

  • entities(state?: object, action: any): any
  • Reducer to handle Actions on the entities object in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

fields

  • fields(state?: object, action: any): any
  • Reducer to handle Actions on the fields object in the currentcontent object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

filter

  • filter(state?: object, action: any): any
  • Reducer to handle Actions on the filter property in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

fullName

  • fullName(state?: string, action: any): any
  • Reducer to handle Actions on the fullName property in the user object.

    Parameters

    • Default value state: string = "Visitor"
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

getAuthenticationError

  • getAuthenticationError(state: any): any

getAuthenticationStatus

  • getAuthenticationStatus(state: any): LoginState

getChildren

  • getChildren(state: any): Object[]

getChildrenActions

  • getChildrenActions(state: any): any

getContent

  • getContent(state: Object, Id: number): any
  • Method to get a Content item from a state object by its Id.

    Parameters

    • state: Object

      Current state object.

    • Id: number

      Id of the Content.

    Returns any

    content. Returns the Content from a state object with the given Id.

getCurrentContent

  • getCurrentContent(state: any): any

getError

  • getError(state: any): any
  • Method to get the error message.

    Parameters

    • state: any

      Current state object.

    Returns any

    Returns the error message.

getFetching

  • getFetching(state: any): any
  • Method to get if the fetching of data is in progress.

    Parameters

    • state: any

      Current state object.

    Returns any

    Returns true or false whether data fetching is in progress or not.

getIds

  • getIds(state: any): any
  • Method to get the ids array from a state object.

    Parameters

    • state: any

      Current state object.

    Returns any

    content. Returns the ids array from the given state.

getOpenedContent

  • getOpenedContent(state: any): any

getRepositoryUrl

  • getRepositoryUrl(state: any): any

getSelectedContentIds

  • getSelectedContentIds(state: any): any

getSelectedContentItems

  • getSelectedContentItems(state: any): any

ids

  • ids(state?: any[], action: any): any
  • Reducer to handle Actions on the ids array in the children object.

    Parameters

    • Default value state: any[] = []
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

isDirty

  • isDirty(state?: boolean, action: any): boolean
  • Reducer to handle Actions on the isDirty property in the contentState object.

    Parameters

    • Default value state: boolean = false
    • action: any

      Represents an action that is called.

    Returns boolean

    state. Returns the next state based on the action.

isFetching

  • isFetching(state?: boolean, action: any): boolean
  • Reducer to handle Actions on the isFetching property in the children object.

    Parameters

    • Default value state: boolean = false
    • action: any

      Represents an action that is called.

    Returns boolean

    state. Returns the next state based on the action.

isOpened

  • isOpened(state?: any, action: any): any
  • Reducer to handle Actions on the isOpened property in the children object.

    Parameters

    • Default value state: any = null
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

isOperationInProgress

  • isOperationInProgress(state?: boolean, action: any): boolean
  • Reducer to handle Actions on the isOperationInProgress property in the contentState object.

    Parameters

    • Default value state: boolean = false
    • action: any

      Represents an action that is called.

    Returns boolean

    state. Returns the next state based on the action.

isSaved

  • isSaved(state?: boolean, action: any): boolean
  • Reducer to handle Actions on the isSaved property in the contentState object.

    Parameters

    • Default value state: boolean = true
    • action: any

      Represents an action that is called.

    Returns boolean

    state. Returns the next state based on the action.

isValid

  • isValid(state?: boolean, action: any): boolean
  • Reducer to handle Actions on the isValid property in the contentState object.

    Parameters

    • Default value state: boolean = true
    • action: any

      Represents an action that is called.

    Returns boolean

    state. Returns the next state based on the action.

language

  • language(state?: string, action: any): any
  • Reducer to handle Actions on the language property in the session object.

    Parameters

    • Default value state: string = "en-US"
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

loginError

  • loginError(state?: string, action: any): any
  • Reducer to handle Actions on the loginError property in the session object.

    Parameters

    • Default value state: string = ""
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

loginState

  • loginState(state?: LoginState, action: any): LoginState
  • Reducer to handle Actions on the loginState property in the session object.

    Parameters

    • Default value state: LoginState = Authentication.LoginState.Pending
    • action: any

      Represents an action that is called.

    Returns LoginState

    state. Returns the next state based on the action.

order

  • order(state?: object, action: any): any
  • Reducer to handle Actions on the order property in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

query

  • query(state?: object, action: any): any
  • Reducer to handle Actions on the query property in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

repository

  • repository(state?: any, action: any): any
  • Reducer to handle Actions on the repostory property in the user object.

    Parameters

    • Default value state: any = null
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

select

  • select(state?: object, action: any): any
  • Reducer to handle Actions on the select property in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

selectedContentItems

  • selectedContentItems(state?: object, action: any): any
  • Parameters

    • Default value state: object = {}
    • action: any

    Returns any

selectedIds

  • selectedIds(state?: any[], action: any): any[]
  • Reducer to handle Actions on the selected array.

    Parameters

    • Default value state: any[] = []
    • action: any

      Represents an action that is called.

    Returns any[]

    state. Returns the next state based on the action.

skip

  • skip(state?: object, action: any): any
  • Reducer to handle Actions on the skip property in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

top

  • top(state?: object, action: any): any
  • Reducer to handle Actions on the top property in the children object.

    Parameters

    • Default value state: object = {}
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

userAvatarPath

  • userAvatarPath(state?: string, action: any): any
  • Reducer to handle Actions on the userAvatarPath property in the user object.

    Parameters

    • Default value state: string = ""
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

userLanguage

  • userLanguage(state?: string, action: any): any
  • Reducer to handle Actions on the userLanguage property in the user object.

    Parameters

    • Default value state: string = "en-US"
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

userName

  • userName(state?: string, action: any): any
  • Reducer to handle Actions on the userName property in the user object.

    Parameters

    • Default value state: string = "Visitor"
    • action: any

      Represents an action that is called.

    Returns any

    state. Returns the next state based on the action.

Generated using TypeDoc