Realigning and simplifying directories and naming. - Combining “containers” into “components”. - Flattening out “data” into “reducers” and “config” to consolidate configuration-like files in one place and to make reducers a peer of its teammates (components, actions, sagas, and services). - Creating dev/prod-specific redux configurations. - Converting “index.jsx” files into files named for their contents. - Splitting up the top-level “index.jsx” file into an entry point and an “App” component. - Renaming SCSS file to “index.scss” to keep it consistent with where it’s imported. - Renaming/simplifying some variables.
18 lines
509 B
JavaScript
Executable File
18 lines
509 B
JavaScript
Executable File
import apiClient from './config/apiClient';
|
|
|
|
const handleTrackEvents = (eventName, properties) => {
|
|
// Simply forward track events to Segment
|
|
window.analytics.track(eventName, properties);
|
|
};
|
|
|
|
|
|
const identifyUser = () => {
|
|
const authState = apiClient.getAuthenticationState();
|
|
if (authState.authentication && authState.authentication.userId) {
|
|
// eslint-disable-next-line no-undef
|
|
window.analytics.identify(authState.authentication.userId);
|
|
}
|
|
};
|
|
|
|
export { handleTrackEvents, identifyUser };
|