Skip to main content

@ada-anvil/sdk-enhancer-react

Table of contents

Type Aliases

Functions

Type Aliases

HookName

Ƭ HookName<Name>: Name extends string ? `use${Capitalize<Name>}` : Name

Type parameters

Name
Name

ReactEnhancerResult

Ƭ ReactEnhancerResult<Getters>: { [K in keyof Getters as Getters[K] extends Record<string, object> ? K : Getters[K] extends Subscribable<object> ? K : never]: Getters[K] extends Record<string, object> ? ReactEnhancerResult<Getters[K]> : Getters[K] extends Subscribable<object> ? ServiceHooks<Getters[K]> : never }

Type parameters

Name
Getters

ServiceHooks

Ƭ ServiceHooks<S>: { [K in keyof S["_subscribableValues"] as HookName<K>]: Function }

Type parameters

NameType
Sextends Subscribable<object>

Functions

reactEnhancer

reactEnhancer<Getters>(getters): Object

Type parameters

NameType
Gettersextends object

Parameters

NameType
gettersGetters

Returns

Object

NameType
name"react"
resultReactEnhancerResult<Getters>

useSubscribable

useSubscribable<V, K>(s, k): V[K]

Type parameters

NameType
Vextends object
Kextends string | number | symbol

Parameters

NameType
sSubscribable<V>
kK

Returns

V[K]


useSubscription

useSubscription<V, K>(s, k, handler): void

Type parameters

NameType
Vextends object
Kextends string | number | symbol

Parameters

NameType
sSubscribable<V>
kK
handler(v: V[K]) => void

Returns

void