"""
Applyable State
"""
[docs]
class Applyable:
"""Applyable State"""
def __init__(self):
[docs]
def apply(self, state):
prev = self._current
if prev is not None and self._is_same(prev, state):
return
self._do_apply(state, prev)
self._current = state
[docs]
def _do_apply(self, state, prev):
raise NotImplementedError
[docs]
def _is_same(self, old, new) -> bool:
raise NotImplementedError