File size: 515 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// @flow
import React from 'react';
import Loadable from 'react-loadable';
import { ErrorView, LoadingView } from 'src/views/viewHelpers';

/* prettier-ignore */
const loader = () => import('./container'/* webpackChunkName: "Thread" */);

const getLoading = () => ({ error, pastDelay }) => {
  if (error) {
    return <ErrorView />;
  } else if (pastDelay) {
    return <LoadingView />;
  }

  return null;
};

export const ThreadView = Loadable({
  loader,
  loading: getLoading(),
  modules: ['./container'],
});