joshburgess / purescript-react-basic-todomvc

TodoMVC with purescript-react-basic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PureScript react-basic TodoMVC

An implementation of TodoMVC in PureScript using the react-basic library.

Project structure

  • Entry point for the app is index.js, that imports React and just instantiates the Todo.Main component (defined in PureScript). This is where you might want to hook up more JS components in your project.
  • The tasklist is defined in the Main component. The list of tasks is kept in this component's State, together with some more things (e.g. the current selector, etc.)
  • The above component then creates a Task component for every task. The only state we need to keep in it is the current edits for a focused Task.
  • Some things are achieved with a thin layer of JS FFI: LocalStorage and routing

Development

## Install npm dependencies, PureScript compiler, etc
yarn install

## Build the PureScript project
yarn build

## Start the dev server with hot reload and stuff
## (that is, if you use `purs ide` that recompiles your stuff on save)
## Note that hot-reload won't work if you change any FFI file,
## so you'll have to `yarn build` again
yarn start

About

TodoMVC with purescript-react-basic

License:MIT License


Languages

Language:PureScript 88.3%Language:JavaScript 7.1%Language:HTML 4.6%