( paths: readonly string[] | string, options?: Chokidar.WatchOptions, )
| 223 | |
| 224 | // export function make(paths: readonly string[] | string, options?: Chokidar.WatchOptions): T.UIO<FileWatcher> { |
| 225 | export function make( |
| 226 | paths: readonly string[] | string, |
| 227 | options?: Chokidar.WatchOptions, |
| 228 | ): T.Effect<unknown, never, FileWatcher> { |
| 229 | return pipe( |
| 230 | T.succeedWith(() => Chokidar.watch(paths, options)), |
| 231 | // T.tap(() => T.succeedWith(() => console.log('start make'))), |
| 232 | T.chain((_) => Ref.makeRef<Chokidar.FSWatcher>(_)), |
| 233 | T.zip(H.makeUnbounded<Ex.Exit<never, E.Either<FileWatcherError, FileSystemEvent>>>()), |
| 234 | // T.tap(() => T.fail(new Error('test'))), |
| 235 | T.chain(({ tuple: [instance, hub] }) => |
| 236 | T.succeedWith(() => new ConcreteFileWatcher(instance, hub, paths, options)), |
| 237 | ), |
| 238 | T.tap((_) => _.subscribeToEvents()), |
| 239 | ) |
| 240 | } |
| 241 | |
| 242 | // export const makeAndSubscribe = ( |
| 243 | // paths: readonly string[] | string, |
no test coverage detected
searching dependent graphs…