Wagtail client-side components
Preparing search index...
components/CommentApp/main
CommentApp
Class CommentApp
Index
Constructors
constructor
Properties
actions
activation
Handlers
layout
selectors
store
utils
Methods
activate
attach
Annotation
Layout
invalidate
Content
Path
make
Comment
on
Activate
render
App
set
Current
Tab
set
User
update
Annotation
update
Content
Path
Constructors
constructor
new
CommentApp
()
:
CommentApp
Returns
CommentApp
Properties
actions
actions
:
{
addComment
:
(
comment
:
Comment
)
=>
AddCommentAction
;
addReply
:
(
commentId
:
number
,
reply
:
CommentReply
)
=>
AddReplyAction
;
deleteComment
:
(
commentId
:
number
)
=>
DeleteCommentAction
;
deleteReply
:
(
commentId
:
number
,
replyId
:
number
)
=>
DeleteReplyAction
;
invalidateContentPath
:
(
contentPath
:
string
)
=>
InvalidateContentPathAction
;
resolveComment
:
(
commentId
:
number
)
=>
ResolveCommentAction
;
setFocusedComment
:
(
commentId
:
null
|
number
,
__namedParameters
?:
{
forceFocus
:
boolean
;
updatePinnedComment
:
boolean
}
,
)
=>
SetFocusedCommentAction
;
updateComment
:
(
commentId
:
number
,
update
:
CommentUpdate
,
)
=>
UpdateCommentAction
;
updateReply
:
(
commentId
:
number
,
replyId
:
number
,
update
:
CommentReplyUpdate
,
)
=>
UpdateReplyAction
;
}
= commentActionFunctions
activation
Handlers
activationHandlers
:
(
()
=>
void
)
[]
= []
layout
layout
:
LayoutController
selectors
selectors
:
{
selectCommentCount
:
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
)
=>
number
;
selectComments
:
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
)
=>
Map
<
number
,
Comment
>
;
selectFocused
:
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
)
=>
null
|
number
;
selectIsDirty
:
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
...
params
:
[
]
,
)
=>
boolean
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
&
{
dependencies
:
[
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
)
=>
Map
<
number
,
Comment
>
,
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
)
=>
number
,
]
;
dependencyRecomputations
:
()
=>
number
;
lastResult
:
()
=>
boolean
;
memoizedResultFunc
:
(
...
resultFuncArgs
:
[
Map
<
number
,
Comment
>
,
number
]
,
)
=>
boolean
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
recomputations
:
()
=>
number
;
resetDependencyRecomputations
:
()
=>
void
;
resetRecomputations
:
()
=>
void
;
resultFunc
:
(
...
resultFuncArgs
:
[
Map
<
number
,
Comment
>
,
number
]
)
=>
boolean
;
}
&
{
argsMemoize
:
<
Func
extends
AnyFunction
>
(
func
:
Func
,
options
?:
WeakMapMemoizeOptions
<
ReturnType
<
Func
>
>
,
)
=>
Func
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
memoize
:
<
Func
extends
AnyFunction
>
(
func
:
Func
,
options
?:
WeakMapMemoizeOptions
<
ReturnType
<
Func
>
>
,
)
=>
Func
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
}
;
}
= ...
store
store
:
Store
utils
utils
:
{
selectCommentFactory
:
(
localId
:
number
,
)
=>
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
...
params
:
[
]
,
)
=>
undefined
|
Comment
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
&
{
dependencies
:
[
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
)
=>
Map
<
number
,
Comment
>
,
]
;
dependencyRecomputations
:
()
=>
number
;
lastResult
:
()
=>
undefined
|
Comment
;
memoizedResultFunc
:
(
...
resultFuncArgs
:
[
Map
<
number
,
Comment
>
]
,
)
=>
undefined
|
Comment
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
recomputations
:
()
=>
number
;
resetDependencyRecomputations
:
()
=>
void
;
resetRecomputations
:
()
=>
void
;
resultFunc
:
(
...
resultFuncArgs
:
[
Map
<
number
,
Comment
>
]
,
)
=>
undefined
|
Comment
;
}
&
{
argsMemoize
:
<
Func
extends
AnyFunction
>
(
func
:
Func
,
options
?:
WeakMapMemoizeOptions
<
ReturnType
<
Func
>
>
,
)
=>
Func
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
memoize
:
<
Func
extends
AnyFunction
>
(
func
:
Func
,
options
?:
WeakMapMemoizeOptions
<
ReturnType
<
Func
>
>
,
)
=>
Func
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
}
;
selectCommentsForContentPathFactory
:
(
contentpath
:
string
,
)
=>
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
...
params
:
[
]
,
)
=>
Comment
[]
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
&
{
dependencies
:
[
(
state
:
{
comments
:
CommentsState
;
settings
:
SettingsState
}
,
)
=>
Map
<
number
,
Comment
>
,
]
;
dependencyRecomputations
:
()
=>
number
;
lastResult
:
()
=>
Comment
[]
;
memoizedResultFunc
:
(
...
resultFuncArgs
:
[
Map
<
number
,
Comment
>
]
,
)
=>
Comment
[]
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
recomputations
:
()
=>
number
;
resetDependencyRecomputations
:
()
=>
void
;
resetRecomputations
:
()
=>
void
;
resultFunc
:
(
...
resultFuncArgs
:
[
Map
<
number
,
Comment
>
]
)
=>
Comment
[]
;
}
&
{
argsMemoize
:
<
Func
extends
AnyFunction
>
(
func
:
Func
,
options
?:
WeakMapMemoizeOptions
<
ReturnType
<
Func
>
>
,
)
=>
Func
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
memoize
:
<
Func
extends
AnyFunction
>
(
func
:
Func
,
options
?:
WeakMapMemoizeOptions
<
ReturnType
<
Func
>
>
,
)
=>
Func
&
{
clearCache
:
()
=>
void
;
resetResultsCount
:
()
=>
void
;
resultsCount
:
()
=>
number
;
}
;
}
;
}
= ...
Methods
activate
activate
()
:
void
Returns
void
attach
Annotation
Layout
attachAnnotationLayout
(
annotation
:
Annotation
,
commentId
:
number
)
:
void
Parameters
annotation
:
Annotation
commentId
:
number
Returns
void
invalidate
Content
Path
invalidateContentPath
(
contentPath
:
string
)
:
void
Parameters
contentPath
:
string
Returns
void
make
Comment
makeComment
(
annotation
:
Annotation
,
contentpath
:
string
,
position
?:
string
,
)
:
number
Parameters
annotation
:
Annotation
contentpath
:
string
position
:
string
= ''
Returns
number
on
Activate
onActivate
(
handler
:
()
=>
void
)
:
void
Parameters
handler
:
()
=>
void
Returns
void
render
App
renderApp
(
element
:
HTMLElement
,
outputElement
:
HTMLElement
,
userId
:
any
,
initialComments
:
InitialComment
[]
,
authors
:
Map
<
string
,
{
avatar_url
:
string
;
name
:
string
}
>
,
)
:
void
Parameters
element
:
HTMLElement
outputElement
:
HTMLElement
userId
:
any
initialComments
:
InitialComment
[]
authors
:
Map
<
string
,
{
avatar_url
:
string
;
name
:
string
}
>
Returns
void
set
Current
Tab
setCurrentTab
(
tab
:
null
|
string
)
:
void
Parameters
tab
:
null
|
string
Returns
void
set
User
setUser
(
userId
:
any
,
authors
:
Map
<
string
,
{
avatar_url
:
string
;
name
:
string
}
>
,
)
:
void
Parameters
userId
:
any
authors
:
Map
<
string
,
{
avatar_url
:
string
;
name
:
string
}
>
Returns
void
update
Annotation
updateAnnotation
(
annotation
:
Annotation
,
commentId
:
number
)
:
void
Parameters
annotation
:
Annotation
commentId
:
number
Returns
void
update
Content
Path
updateContentPath
(
commentId
:
number
,
newContentPath
:
string
)
:
void
Parameters
commentId
:
number
newContentPath
:
string
Returns
void
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
actions
activation
Handlers
layout
selectors
store
utils
Methods
activate
attach
Annotation
Layout
invalidate
Content
Path
make
Comment
on
Activate
render
App
set
Current
Tab
set
User
update
Annotation
update
Content
Path
Wagtail client-side components
Loading...