gen_frp v0.1.0 GenFRP.Example.Map

Summary

Functions

The initial state that the GenFRP-module will have when it is started

Takes the current state and returns something useful. The second argument passed to render is the state that was the output of the last time render was called

Takes the current state and ‘some’ event and returns a new state

Functions

initial_state()

The initial state that the GenFRP-module will have when it is started.

render(state, last_rendered_state)

Takes the current state and returns something useful. The second argument passed to render is the state that was the output of the last time render was called.

This is done so implementations of render can, if they want, use sophisticated algorithms that work on the patch or diff of changes between the two states,

instead of re-creating a whole new output each time.

update(state, event)

Takes the current state and ‘some’ event and returns a new state.