config#USE_SAMPLE_DATA TypeScript Examples

The following examples show how to use config#USE_SAMPLE_DATA. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: store.ts    From lightning-terminal with MIT License 6 votes vote down vote up
createStore = (grpcClient?: GrpcClient, appStorage?: AppStorage) => {
  const grpc = grpcClient || new GrpcClient();
  // Resolve api requests with sample data when running client in develop mode.
  grpc.useSampleData = USE_SAMPLE_DATA;

  const storage = appStorage || new AppStorage();
  const lndApi = new LndApi(grpc);
  const loopApi = new LoopApi(grpc);
  const poolApi = new PoolApi(grpc);
  const litApi = new LitApi(grpc);
  const csv = new CsvExporter();
  const history = createBrowserHistory();

  const store = new Store(
    lndApi,
    loopApi,
    poolApi,
    litApi,
    storage,
    history,
    csv,
    actionLog,
  );

  // initialize the store immediately to fetch API data, except when running unit tests
  if (!IS_TEST) store.init();

  // in dev env, make the store accessible via the browser DevTools console
  if (IS_DEV) (global as any).store = store;

  return store;
}