O1Library Docs
Fall 2023
Docs API

# RefreshPolicy

o1.gui.View$.RefreshPolicy
See the RefreshPolicy companion object
trait RefreshPolicy

A supertype for the different policies for updating the image visible in a `View` in response to a change in the model.

Note to students: You’re unlikely to need this for anything in O1.

## Attributes

Companion
  object
Graph
Supertypes
  class Object
  trait Matchable
  class Any
Known subtypes
  object Always.type
  object UnlessIdentical.type
  object UnlessSameReference.type

## Members list

### Value members

#### Abstract methods

def shouldRefresh(from: Matchable, to: Matchable): Boolean

Returns a `Boolean` that indicates whether the `View` should try to update itself after observing a given state of the model.

Returns a `Boolean` that indicates whether the `View` should try to update itself after observing a given state of the model.

## Parameters

from

  the model object at the previous update

to

  the current model object (possibly the same object; possibly identical)

## Attributes