Presto
GitHub
Getting Started
Packages
View Model
BaseViewModel
isViewModelClass
isViewModelInstance
viewModelFactory
Async Choices
AsyncChoices
AsyncChoicesInterface
useAsyncChoices
Caching
useViewModelCache
ViewModelCache
Errors
InvalidFieldError
MissingFieldsError
Fields
BooleanField
CharField
DateField
DateRangeField
DateTimeField
DateTimeRangeField
DecimalField
DecimalRangeField
EmailField
Field
FileField
FloatField
FloatRangeField
ImageField
IntegerField
IntegerRangeField
JsonField
ListField
ManyRelatedViewModelField
NumberField
PasswordField
RangeField
RelatedViewModelField
TextField
TimeField
URLField
Utils
normalizeFields
ViewModelFieldPaths
Final Form
REST
Routing
UI
UI ANTD
Util
On this page
Usage
Arguments
Examples
Basic usage
Selector with arguments
useViewModelCache
Source
import { useViewModelCache } from "@prestojs/viewmodel";
useViewModelCache
<
ViewModelType
,
ResultType
,
SelectorArgs
=
any
[]
>
(
viewModel
,
selector
,
?args
,
?isEquals
)
Source
Arguments:
Argument
Type
Description
*
viewModel
ViewModelType
*
selector
Function
args
SelectorArgs
isEquals
Function
Returns:
ResultType
Examples
Javascript
Typescript
Basic usage
Show Code
Selector with arguments
Show Code