1.4.0 • Published 4 years ago

@schibstedspain/sui-gigya-global-events v1.4.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

GigyaGlobalEvents

Description

This component acts as a middleware between Gigya event handler and our components or use cases. The main reason is because Gigya has no way to clear the registered listeners, this leads to errors when our SPA mounts a component multiple times.

This solution allow us to register as many listeners as we want, and provide us with the ability to unregister on change props or when the component is unmounted.

Installation

$ npm install @schibstedspain/sui-gigya-global-events --save

Usage

Basic usage

import GigyaGlobalEvents from '@schibstedspain/sui-gigya-global-events'

return (<GigyaGlobalEvents onLogin={event => console.log('This will be executed onLogin')} onLogout={event => console.log('This will be executed onLogout')} />)

To see the full list of global events check Gigya Documentation

Find full description and more examples in the demo page.