Liking cljdoc? Tell your friends :D
Mostly cljs.
Exceptions indicated.

dk.simongray.like-minded.store.folder

A folder as a document store, e.g. one that a sync client mirrors.

The folder can be a Git working tree, or a folder of iCloud Drive, Dropbox, Google Drive, OneDrive, Seafile, Syncthing or Nextcloud. Each device writes only its own file, so the sync client has no conflicts to resolve. The folder is one of these:

  • a path, on the JVM and in Node
  • a FileSystemDirectoryHandle in a browser, e.g. a folder that the user picked with showDirectoryPicker, or the site's own folder of the origin private file system, from navigator.storage.getDirectory(), for what an app keeps on the device
  • the files of a file input or a drop in a browser, which are read only

A body is kept as it was put, text or bytes, and a fetch with {:as :bytes} reads it as bytes.

In a browser that can't pick a folder, the user can still sync through one by hand: save the device's sync document into the folder, and load the folder's files with a file input. A browser's permission for a picked folder can lapse between visits, so check it before a sync, and renew it from a click.

A file is written whole and replaces the old one, so a sync client never sees half of one. The version of a file is its modification time and size, which tells two writes apart as finely as the file system keeps time. In a browser, the failures that the user can fix have a :type in their ex-data:

  • ::not-allowed, a permission to renew
  • ::gone, a folder that was moved, deleted or unplugged
  • ::read-only, a folder that the browser can't write to
A folder as a document store, e.g. one that a sync client mirrors.

The folder can be a Git working tree, or a folder of iCloud Drive,
Dropbox, Google Drive, OneDrive, Seafile, Syncthing or Nextcloud. Each
device writes only its own file, so the sync client has no conflicts to
resolve. The folder is one of these:

- a path, on the JVM and in Node
- a FileSystemDirectoryHandle in a browser, e.g. a folder that the
  user picked with showDirectoryPicker, or the site's own folder of
  the origin private file system, from navigator.storage.getDirectory(),
  for what an app keeps on the device
- the files of a file input or a drop in a browser, which are read only

A body is kept as it was put, text or bytes, and a fetch with
{:as :bytes} reads it as bytes.

In a browser that can't pick a folder, the user can still sync
through one by hand: save the device's sync document into the folder,
and load the folder's files with a file input. A browser's permission
for a picked folder can lapse between visits, so check it before a
sync, and renew it from a click.

A file is written whole and replaces the old one, so a sync client never
sees half of one. The version of a file is its modification time and
size, which tells two writes apart as finely as the file system keeps
time. In a browser, the failures that the user can fix have a :type
in their ex-data:

- ::not-allowed, a permission to renew
- ::gone, a folder that was moved, deleted or unplugged
- ::read-only, a folder that the browser can't write to
raw docstring

query-permission!cljs

(query-permission! dir)

The browser's permission to read and write the folder dir: :granted, :prompt or :denied, as a promise.

A path, a folder of the origin private file system and the files of an input have nothing to ask for, so they give :granted.

The browser's permission to read and write the folder `dir`: :granted,
:prompt or :denied, as a promise.

A path, a folder of the origin private file system and the files of an
input have nothing to ask for, so they give :granted.
sourceraw docstring

request-permission!cljs

(request-permission! dir)

Ask the user to let the app read and write the folder dir, and give the answer, :granted, :prompt or :denied, as a promise.

A browser only asks during a click, so call it from one.

Ask the user to let the app read and write the folder `dir`, and
give the answer, :granted, :prompt or :denied, as a promise.

A browser only asks during a click, so call it from one.
sourceraw docstring

storeclj/s

(store dir)

The store over the folder dir: a path, or in a browser a directory handle or the files of an input.

A directory at a path is made on the first write, and hidden files aren't documents. The files of an input are read only, so their store has no put or delete.

The store over the folder `dir`: a path, or in a browser a directory
handle or the files of an input.

A directory at a path is made on the first write, and hidden files
aren't documents. The files of an input are read only, so their store
has no put or delete.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close