Live data from Hacker News

Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

github.com

1–10 of 42 posts

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#2
Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out.

Also, the optimistic updates with rollbacks in this implementation is pretty neat.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#3
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

MobX is quite popular, and I wouldn't call it a variant of redux.

Also, just storing state in your higher level components can work for much more complicated apps than many think.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#4
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

its better to search for "flux alternatives" since flux was the earliest react state management library

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#5
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

I have no experience with either (I write library code, not app code) but I see MobX mentioned here frequently.

Here is a comparison.

https://www.robinwieruch.de/redux-mobx-confusion/

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#6
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

I've been using baobab[1] which is:

> a JavaScript persistent and immutable (at least by default) data tree supporting cursors and enabling developers to easily navigate and monitor nested data through events.

It's a fairly simple library to read and understand and it's well written. I have a couple decent sized SPAs working on top of it, and I store the full data tree using localForage for offline use.

1: https://github.com/Yomguithereal/baobab

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#8
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

It's also quite easy to roll your own solution. I used to do this before I heard about Redux, and the whole library was ~100 lines I think (not including tests). My implementation exposed a store and allowed you to subscribe to "events" on it (postAdded, etc). It ended up working similarly to Redux, but without the reducers (you would just handle the event in-place).

That said, these days I would never use anything but Redux. MobX is gaining traction as a viable alternative, but I just love having all possible mutations spelled out explicitly.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#9
post #7

I'm re-learning Redux now, does anyone else think that it might be overkill for an app that doesn't require any user input?

If all your data is read-only, then yes, Redux is probably overkill. You'd be fine just passing the data down as props from a higher-level component.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#10
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

I've been using Mobx very successfully on many of my projects now (both React & React Native). I'll prefer Mobx any day over Redux, just due to it's sheer simplicity and ease of use. Read: No need to burden your brain with the cognitive load of actions, reducers, dispatching actions, selectors etc.

Mobx v/s Redux does kick off the OOP v/s Functional debate, but as a developer my productivity and effectiveness is measured in terms of my ability to ship software not in terms of my programming style, and it's my personal belief that Mobx does make me more productive as compared to Redux.

For developers new to the whole Flux/Redux/Mobx/State Management world, I highly suggest to give Mobx a try.

Post reply on HN