Class: CacheEntryService<T>
Type parameters
Name |
---|
T |
Hierarchy
↳
CacheEntryService
Constructors
constructor
• new CacheEntryService<T
>()
Type parameters
Name |
---|
T |
Inherited from
DefaultGlobalService.constructor
Properties
[combinedReducers]
• [combinedReducers]: (state
: any
, action
: any
) => any
Type declaration
▸ (state
, action
): any
Parameters
Name | Type |
---|---|
state | any |
action | any |
Returns
any
Inherited from
DefaultGlobalService.[combinedReducers]
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:63
[dispatch]
• [dispatch]: any
Inherited from
DefaultGlobalService.[dispatch]
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:62
[inReducer]
• [inReducer]: boolean
Inherited from
DefaultGlobalService.[inReducer]
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:64
[reducers]
• [reducers]: any
Inherited from
DefaultGlobalService.[reducers]
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:59
[sagas]
• [sagas]: any
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:61
[types]
• [types]: any
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:60
context
• context: AppContext
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/app/AppService.ts:8
state
• state: AnyState
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:66
Methods
[create]
▸ [create](initialState
): void
Parameters
Name | Type |
---|---|
initialState | AnyState |
Returns
void
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:69
[run]
▸ [run](): void
Returns
void
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/app/GlobalService.ts:7
[stop]
▸ [stop](): void
Returns
void
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/app/GlobalService.ts:15
delayLoading
▸ delayLoading(key
, delay_ms?
): Generator
<void
| CallEffect
<true
>, void
, unknown
>
Parameters
Name | Type |
---|---|
key | string |
delay_ms? | number |
Returns
Generator
<void
| CallEffect
<true
>, void
, unknown
>
Defined in
onekijs/packages/onekijs-framework/src/app/CacheEntryService.ts:48
fetch
▸ fetch(url
, options?
, force?
): Generator
<void
| ForkEffect
<Generator
<void
| CallEffect
<true
>, void
, unknown
>> | Promise
<any
> | CancelEffect
| CallEffect
<unknown
>, void
, Task
& Response
& T
>
Get the object from the server and save it in the cache (= redux store)
Parameters
Name | Type | Default value |
---|---|---|
url | string | undefined |
options | CacheOptions <T > | {} |
force | boolean | false |
Returns
Generator
<void
| ForkEffect
<Generator
<void
| CallEffect
<true
>, void
, unknown
>> | Promise
<any
> | CancelEffect
| CallEffect
<unknown
>, void
, Task
& Response
& T
>
Defined in
onekijs/packages/onekijs-framework/src/app/CacheEntryService.ts:92
setCache
▸ setCache(key
, cacheEntry?
): void
Save the object to cache in the redux store Several metadata are atttached to the object (expireAt, loading, fetching)
Parameters
Name | Type | Description |
---|---|---|
key | string | - |
cacheEntry? | CacheEntry <T > | : the object with metadata |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/app/CacheEntryService.ts:63
setError
▸ setError(key
, error?
): void
Parameters
Name | Type |
---|---|
key | string |
error? | BasicError |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/app/CacheEntryService.ts:68
setLoading
▸ setLoading(key
, loading
, fetching
): void
Parameters
Name | Type |
---|---|
key | string |
loading | boolean |
fetching | boolean |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/app/CacheEntryService.ts:74