@segment/analytics-react-native
Version:
The hassle-free way to add Segment analytics to your React-Native app.
25 lines (24 loc) • 612 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BackgroundFlushPolicy = void 0;
var _types = require("./types");
/**
* StatupFlushPolicy triggers a flush right away on client startup
*/
class BackgroundFlushPolicy extends _types.FlushPolicyBase {
start() {
// Nothing to do
}
onEvent(_event) {
if ('event' in _event && _event.event === 'Application Backgrounded') {
this.shouldFlush.value = true;
}
}
end() {
// Nothing to do
}
}
exports.BackgroundFlushPolicy = BackgroundFlushPolicy;
//# sourceMappingURL=background-flush-policy.js.map