@segment/analytics-react-native
Version:
The hassle-free way to add Segment analytics to your React-Native app.
19 lines (18 loc) • 448 B
JavaScript
import { FlushPolicyBase } from './types';
/**
* StatupFlushPolicy triggers a flush right away on client startup
*/
export class BackgroundFlushPolicy extends FlushPolicyBase {
start() {
// Nothing to do
}
onEvent(_event) {
if ('event' in _event && _event.event === 'Application Backgrounded') {
this.shouldFlush.value = true;
}
}
end() {
// Nothing to do
}
}
//# sourceMappingURL=background-flush-policy.js.map