Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "src/chrono/Effect"

Index

Classes

Variables

Functions

Variables

Const ProposedOrPrevious

ProposedOrPrevious: Effect = Effect.new({ handler : ProposedOrPreviousSymbol })

The constant that represents a request for either user input (proposed value) or previous value of the identifier, currently being calculated.

Important note, is that if an identifier yields a ProposedOrPrevious effect and its computed value does not match the value of this effect, it will be re-calculated (computation function called) again on the next read. This is because the value of its ProposedOrPrevious input changes.

const graph4 = ChronoGraph.new()

const max           = graph4.variable(100)

const identifier15  = graph4.identifier((Y) : number => {
    const proposedValue : number    = Y(ProposedOrPrevious)

    const maxValue : number         = Y(max)

    return proposedValue <= maxValue ? proposedValue : maxValue
})

graph4.write(identifier15, 18)

const value15_1 = graph4.read(identifier15) // 18

graph4.write(identifier15, 180)

const value15_2 = graph4.read(identifier15) // 100

graph4.write(max, 50)

const value15_3 = graph4.read(identifier15) // 50

Functions

Const Reject

  • This is constructor for RejectEffect class. If this effect will be yielded during computation the current transaction will be rejected.

    Type parameters

    • Reason

    Parameters

    • reason: Reason

    Returns RejectEffect<Reason>

Generated using TypeDoc