Skip to content

Initial Improvement

Compare
Choose a tag to compare
@andrejewski andrejewski released this 15 Aug 13:04
· 49 commits to master since this release

This release changes the raj/react syntax. The init is no longer a function that receives props. See the justification for this change in PR #9. What this means for developers is that,

function init () {
  return [model, effect]
}
// becomes
const init = [model, effect]

And React components are built like:

import React from 'react'
import {program} from 'raj/react'

program(React.Component, props => ({
  init: [state, effect],
  update: (message, state) => [state, effect],
  view: (state, dispatch) => {}
}))

This change makes the ecosystem more consistent for things like raj-spa.