0.3.0 • Published 8 months ago
@peassoft/mnr-web-topline v0.3.0
@peassoft/mnr-web-topline
Topline widget for mem'n'rev web applications.
Usage Example
import { useCallback } from 'react';
import WebTopline, {
ToplineService,
ToplineUser,
} from '@peassoft/mnr-web-topline';
export default function Topline(): JSX.Element {
const handleReady = useCallback(
async(toplineService: ToplineService, toplineUser: ToplineUser | null) => {
toplineService
.on('userChange', user => {
//
})
.on('logout', () => {
//
})
.on('syncNotification', syncId => {
//
});
// Use toplineService and toplineUser somehow else
},
[],
);
return (
<WebTopline
onReady={handleReady}
onError={(err: Error) => {/* Handle the error */}}
/>
);
}API Reference
Refer to the file index.d.ts.