abort: (msg: string) => void;
failOn: (predicate: any => boolean, msg: string) => void;
type txConfig = {retries: number} | {rootTx: transaction}
fn: {fs: WNFS, tx: transaction} => value,
): Promise<{tx: transaction, value: value}>
const nestedTx = async () => wnfs.atomic({fs, tx} => {
// more transactional actions
await wnfs.atomic({fs, tx} => {
fs.create(["photos", "vacation.png"], {
fs.rm(["public", "photos", "holiday.gif"])
await nestedTx().bind(this) // or something
fs.modify(["public", "documents"], {directory, metadata: oldMeta, tx} => {
directory.contents.find()
dir: [...directory, newFile],
metadata: {...oldMeta, lastTouchedBy: me}