Feed + Log API
Types
Feedlog Methods
post
post
feedlog.post(content: Content)
Params: content
to post to the feedlog.
Returns: A promise resolving to a string
(the post ID) on success or undefined
on failure.
Add a new post to the feedlog. Automatically stores the creation time and author.
edit
edit
feedlog.edit(id: string, newContent: Content)
Params: The id
of the post to edit, and newContent
to replace it with.
Returns: A promise resolving to a string
(the post ID) on success or undefined
on failure.
Edit a post in the feedlog. Automatically stores the updated time and author.
delete
delete
feedlog.delete(id: string)
Params: The id
of the post to delete.
Returns: A promise resolving to true
on success or false
on failure.
Delete a post from the feedlog. If the post with id
does not exist, returns true
.
clear
clear
feedlog.clear()
Returns: A promise resolving to true
on success or false
on failure.
Clear all posts from the feedlog.
get
get
feedlog.get(id: string, allowCachedValue: boolean = true)
Params: The id
of the post to retrieve. If allowCachedValue
is true
, we will check the cache before querying Urbit.
Returns: A promise resolving to a FeedlogEntry
or undefined
if the post does not exist.
Get the post from the feedlog with the given id
.
all
all
feedlog.all(useCache: boolean = false)
Params: If useCache
is true
, return the current cache instead of querying Urbit. Only relevant if preload
was set to false
.
Returns: A promise resolving to a FeedlogEntry[]
Retrieve all posts from the feedlog, sorted by newest first.
Feed Methods
setLink
setLink
feed.setLink(id: string, content: Content)
Params: The id
of the post to link to, and the content
to associate with it.
Returns: A promise resolving to true
on success or false
on failure.
Associate a "link" (comment, reaction, etc.) with the feed post corresponding to id
. Post links are stored as an object where keys are ship names and values are content. setLink
will overwrite the link for the current ship, so call get
first if you would like to append.
removeLink
removeLink
feed.removeLink(id: string)
Params: The id
of the post to remove the link from.
Returns: A promise resolving to true
on success or false
on failure.
Remove the current ship's link to the feed post corresponding to id
. If the post with id
does not exist, returns true.
Last updated