Skip to content

v1.0.0

Compare
Choose a tag to compare
@pedronauck pedronauck released this 21 Aug 18:09
· 31 commits to master since this release

Changelog

⚠️  BREAKING CHANGE

  • refactor: remove context and state provider (34523c3)

Now you don't need to use the <State> component as provider for state, just use get, set or selectors on the fly wherever you want:

import React from 'react'
import { create } from 'reworm'

const { set, get } = create({ name: 'John' })

class App extends React.Component {
  componentDidMount() {
    set(prev => ({ name: 'Peter' + prev.name }))
  }
  render() {
    return (
      <div>{get(s => s.name)}</div>
    )
  }
}