Kea

Languages and libraries

state management library

SHOW HN2017

Kea

The power of Redux with the simplicity of MobX

kea.js.org

#redux#mobx#react state management#react

60points
39comments
#710of 2,242 in 2017
Top 32%of 2017 by points

How HN took it

MixedNo clear lean

3 positive, 4 neutral or asking, 1 mixed, 6 critical, out of 14 comments about the project. Thread score -0.08.

Design: 1 for, 3 againstIdea: 2 for, 1 againstExecution: 0 for, 1 againstDocs: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Reduces Redux boilerplate and is clean to read

    From 2 comments
    • Thanks for sharing those functions. Definitely cuts down on a lot of the boilerplate I see with Redux.
      nathancahill on HN
    • The concept expressed in the title matches a desire. Looking forward to checking out and hearing other's experiences.
      dpnewman on HN

Objections

  • The Slider example is overwrought for a simple carousel

    From 2 comments
    • I know it's just an example... But the Slider code is ridiculously overwrought. Building this type of image carousel is trivial with just plain HTML+CSS+JS. This example uses…
      pavlov on HN
    • Just to clarify, I'm not picking on you; I realize it's hard to come up with meaningful examples. The problem with Slider is that it doesn't readily extrapolate into anything…
      pavlov on HN
  • Decorator syntax is unfamiliar and discouraged by React and Redux teams

    From 2 comments
    • Looks pretty neat. My initial reactions: - I don't like the `@kea(...` because it's another bit of JS syntax I hadn't heard of before. Though I do like decorators in Python, I…
      kasbah on HN
    • It's worth noting that both the React and Redux teams generally discourage the use of decorators. Quoting the Create-React-App README: > Create React App doesn’t support…
      acemarke on HN
  • Duplication between action names and reducers remains

    From 2 comments
    • Looks pretty neat. My initial reactions: - I don't like the `@kea(...` because it's another bit of JS syntax I hadn't heard of before. Though I do like decorators in Python, I…
      kasbah on HN
    • Hey, 1) As munchor pointed out, you don't need to use the decorators. See the "what is this @kea()" button in the first guide for more details: https://kea.js.org/guide/counter…
      mariusandra on HN

Requests

  • Better type safety, such as Flow or TypeScript support

    From 2 comments
    • Is this type-safe? Can it infer the payload type somehow? With MobX you can write type-safe code, and it's pretty important in bigger code bases. Redux can be made type-safe but…
      Ciantic on HN
    • Hi, propTypes are supported as an (optional) first class citizen. Thus whatever is the output of a reducer or a selector, provided it is passed to a react component, is type…
      mariusandra on HN
  • Less decorator-heavy API, with properties defined in the class

    From 2 comments
    • I'm a big fan of decorators, but it seems like much of the React/Redux world is overly class-decorator happy. It's really common to define properties in a decorator which would…
      spankalee on HN
    • > That said, the magic with having a big options hash in the `@kea({})` call itself is that then you can easily disconnect the logic from your components as your application…
      spankalee on HN

Questions

  • Why not just use plain React state for these examples

    From 1 comment
    • Why not just use state, which seems like the correct solution to the examples?
      OliverLassen on HN
  • How does it handle async flows like redux-saga

    From 2 comments
    • If my favorite part of redux is structuring flows with redux-saga, does mobx-state-tree have a solution for me? For example, this is nice: ``` // On login, spin off the auth…
      arstin on HN
    • MST doesn't have the same restrictions as redux in terms of async so you don't need to do it in the same way. Edit: In MST it would look more like plain js: ``` class AuthStore()…
      aidos on HN

Alternatives named

  • MobX State Tree

    From 2 comments
    • Shameless plug for another take on the same promise: https://github.com/jnorth/megalith I think most people who are attracted to Redux's core principals but want a more…
      north on HN
    • Looks nice. Seems to do a good job of making the code easy to read. I'm assuming you started this before mobx state tree? It looks very similar. After much experimentation, MST…
      aidos on HN
  • Megalith

    From 1 comment
    • Shameless plug for another take on the same promise: https://github.com/jnorth/megalith I think most people who are attracted to Redux's core principals but want a more…
      north on HN
  • Recompose

    From 1 comment
    • Looks nice, but I think I can get most of it using recompose, which I've been using extensively lately.
      armandososa on HN
  • react-organism

    From 1 comment
    • I’ve made a lightweight React library influenced by functional setState, and supports async/await/Promises, extracting values from DOM / forms easily, pure function actions,…
      burntcaramel on HN
  • Redux boilerplate helpers from Redux docs

    From 1 comment
    • Also worth noting that the Redux docs _specifically_ have a section called "Reducing Boilerplate" [0] that shows how to write functions like this, and my Redux addons catalog [1]…
      acemarke on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/14859206)