Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

@textile/hub > Buckets > archiveWatch

Buckets.archiveWatch() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

archiveWatch watches status events from a Filecoin bucket archive.

Signature:

archiveWatch(key: string, callback: (reply?: {
        id: string | undefined;
        msg: string;
    }, err?: Error) => void): Promise<() => void>;

Parameters

ParameterTypeDescription
keystringUnique (IPNS compatible) identifier key for a bucket.
callback(reply?: { id: string | undefined; msg: string; }, err?: Error) => void

Returns:

Promise<() => void>

Example

Watch deal state changes for a active bucket archive request.

import { Buckets } from '@textile/hub'

async function logChanges (buckets: Buckets, key: string) {
   const log = (reply?: {id?: string, msg: string}, err?: Error | undefined) => {
       if (err || !reply) return console.log(err)
       console.log(reply.id, reply.msg)
   }
   buckets.archiveWatch(key, log)
}

  • Buckets.archiveWatch() method
  • Parameters
  • Example
Hub JS Package
Docs
Getting StartedThreadDBBuckets
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @textileio