@ionic/portals
v0.10.0
Published
SDK Plugin for Ionic Portals
Downloads
4,827
Readme
Ionic Portals
Plugin SDK for Ionic Portals
Install
npm install @ionic/portals
API
getInitialContext()
getInitialContext<T = unknown>() => any
Returns: any
publish(...)
publish<TData>(message: PortalMessage<TData>) => any
| Param | Type |
| ------------- | -------------------------------------------------------------------- |
| message
| PortalMessage<TData> |
Returns: any
subscribe(...)
subscribe<T = unknown>(options: SubscribeOptions, callback: SubscriptionCallback<T>) => any
| Param | Type |
| -------------- | ------------------------------------------------------------- |
| options
| SubscribeOptions |
| callback
| (result: { topic: string; data: T; }) => void |
Returns: any
unsubscribe(...)
unsubscribe(options: PortalSubscription) => any
| Param | Type |
| ------------- | ----------------------------------------------------------------- |
| options
| PortalSubscription |
Returns: any
Interfaces
InitialContext
| Prop | Type |
| ------------ | --------------------------------------- |
| name
| string |
| value
| T |
| assets
| { [key: string]: string; } |
PortalMessage
| Prop | Type |
| ----------- | ------------------- |
| topic
| string |
| data
| TData |
SubscribeOptions
| Prop | Type |
| ----------- | ------------------- |
| topic
| string |
PortalSubscription
| Prop | Type |
| --------------------- | ------------------- |
| subscriptionRef
| number |
| topic
| string |