SDK Plugin for Ionic Portals
npm install @ionic/portalsPlugin SDK for Ionic Portals
``bash`
npm install @ionic/portals
* getInitialContext()
* publish(...)
* subscribe(...)
* unsubscribe(...)
* Interfaces
`typescript`
getInitialContext
Returns: any
--------------------
`typescript`
publish
| Param | Type |
| ------------- | -------------------------------------------------------------------- |
| message | PortalMessage<TData> |
Returns: any
--------------------
`typescript`
subscribe
| Param | Type |
| -------------- | ------------------------------------------------------------- |
| options | SubscribeOptions |
| callback | (result: { topic: string; data: T; }) => void |
Returns: any
--------------------
`typescript`
unsubscribe(options: PortalSubscription) => any
| Param | Type |
| ------------- | ----------------------------------------------------------------- |
| options | PortalSubscription |
Returns: any
--------------------
#### 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 |