enum.each
0.000000

Iterates over an enumerable.

Arguments
procrequired
The proc to call with each enumerable value.
Return Value
The values from the given enumerable.
something went wrong :(
Deleting multiple keys in the key-value store
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.enum.each.call(["foo", "bar", "baz"]) {
  client.keyv.delete(bucket: "some-bucket")
}
client.enum.each.call(["foo", "bar", "baz"], () {
  return client.keyv.delete(undefined, {bucket: "some-bucket"});
});
curl "https://proc.run/enum/each" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/vnd.proc+json" \
--header "accept: text/plain" \
--data '[[">>", ["%%", ["foo", "bar", "baz"]]], ["$$", "proc", ["{}", ["()", "keyv.delete", ["$$", "bucket", ["%%", "some-bucket"]]]]]]'
 

["foo", "bar", "baz"]

enum.* procs can iterate over cursors in addition to arrays—learn more in the docs.


Stuck? Want to chat about an idea? Join the community on Discord.