1import { useCallback, useEffect, useMemo, useState } from 'react';
2import { Config, RollerRPCAPI, Options } from '@urbit/roller-api';
3import { isDevelopment } from './flags';
5export default function useRoller() {
6 const [config, setConfig] = useState<Config | null>(null);
8 const options: Options = useMemo(() => {
9 const type = isDevelopment ? 'http' : 'https';
10 // TODO: What is the prod host?
11 const host = isDevelopment ? 'localhost' : 'bridge.urbit.org';
13 const path = '/v1/roller';
24 const api = useMemo(() => {
25 return new RollerRPCAPI(options);
28 const fetchConfig = useCallback(async () => {
35 // TODO: more elegant error handling
37 '[fetchConfig:failed] is roller running on localhost?\n',
43 // On load, get initial config
50 }, [config, fetchConfig]);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list