Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CommitStrategyBasic

Resolves the final state of an object from the constituent set of commits for that object.

This class works only with objects using the basic commit strategy.

Hierarchy

  • CommitStrategyBasic

Index

Methods

Protected compareCommits

  • Compares two commits (which must belong to the same object) in order to evaulate which one is more recent.

    Follows the conventions of the JavaScript sort() method:

    • -1 indicates that a comes before (i.e. is older than b)
    • 1 indicates that a comes after (i.e. is newer than b)

    Parameters

    Returns 1 | -1

resolveObject

  • Resolves the current state of an object with the basic commit strategy.

    TODO: This class currently returns only the raw object payload. Once we add an object instance class to the SDK (e.g. HubObject), this method will no longer be called directly, and will also need to return the app-readable object metadata.

    Currently returns null if the object was deleted, otherwise returns the most recent payload.

    Parameters

    • commits: SignedCommit[]

      The entire known set of commits for the object.

    Returns Promise<any>

Generated using TypeDoc