Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 527 Bytes

File metadata and controls

18 lines (13 loc) · 527 Bytes

addFlushListener

The addMutationListener triggers whenever there is a mutation. The addFlushListener triggers whenever Overmind tells components to render again. It can have multiple mutations related to it.

{% tabs %} {% tab title="overmind/onInitialize.ts" %}

import { OnInitialize } from 'overmind'

const onInitialize: OnInitialize = async ({ state, effects }, overmind) => {
  overmind.addFlushListener(effects.history.addMutations)
}

export default onInitialize

{% endtab %} {% endtabs %}