Run a cancellable asynchronous action triggered via file system (FS) events.
- Utilizes chokidar to monitor FS events in a directory.
- Configuration for watch options can be found in
src/config.ts.
- Configuration for watch options can be found in
- Upon any FS event, a "Cancellable" action is initiated. The cancellable action is crafted using c-promise2.
- Explore CodeSandbox examples in the c-promise2 repository to understand its usage.
- Refer to this video for insights into how
generator/yieldis employed to writeasync/awaitlogic.- Generator functions are employed by
c-promise2to create cancellable asynchronous routines.
- Generator functions are employed by
- A custom
ShellProcessclass is available insrc/utils/ShellProcess.tsfor executing cancellable terminal commands.
- Run development script:
yarn dev - Build script:
yarn build- Outputs to
/dist
- Outputs to
- Refer to
src/event-action.example.tsfor an example demonstrating how to create cancellable logic. - Subsequent triggers of the Event Action will cancel the previously triggered Event Action if it is still running.
- This video demonstates the working of
src/event-action.example.ts
Kapture.2024-01-12.at.09.58.09.mp4
- The current examples may have incomplete TypeScript type definitions due to the absence of type definitions for the
c-promise2library.