run

package
v0.0.0-...-917641f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package run implements a custom change that applies to a sequence of array elements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Run

type Run struct {
	Offset, Count int
	changes.Change
}

Run implements a custom change type which applies a provided inner change to a run of items in an array. This is particularly useful for rich text operations

func (Run) ApplyTo

func (r Run) ApplyTo(ctx changes.Context, v changes.Value) changes.Value

ApplyTo just converts the method into a set of path changes

func (Run) Merge

func (r Run) Merge(o changes.Change) (changes.Change, changes.Change)

Merge implements the main merge routing for a change

func (Run) MergePath

func (r Run) MergePath(p []interface{}) *refs.MergeResult

MergePath implements the method needed to work with refs.Merge

func (Run) ReverseMerge

func (r Run) ReverseMerge(o changes.Change) (changes.Change, changes.Change)

ReverseMerge is like Merge except the args and receiver are inverted. Basically if someone calls "ch.Merge(r)" and ch does not know how to implement merge with r, it calls r.ReverseMerge(ch).

func (Run) Revert

func (r Run) Revert() changes.Change

Revert undoes the effect of the Run

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL