Comments (9)
Yep that makes sense to leave the current as the default @mikestead
I'd be happy to help add this when we've got a new project that we're going to base on OpenAPI. Maybe @jedrichards and I could take a look at it? Anyways yes let's leave it open in the hopes that one of us has a project that makes it worthwhile.
from openapi-client.
(Disclaimer – I don't know TypeScript, but this looks like a pretty vanilla JS change anyways)
from openapi-client.
Oh and obvs I could do this in my reducer, but I think it's tidier to do all the main switching on actions.
from openapi-client.
Quick bump on this @mikestead – thoughts?
from openapi-client.
@shankiesan I can see the angle you're coming from but I'm not totally sure about this one.
As we always dispatch a FSA you can add middleware to inspect all actions for errors. From there you could siphon off more specific actions as required.
An aim here is to give some basic wiring but to also keep things light and not get too opinionated around how Redux has been setup. Not super easy, but was one of the reasons I went with FSA as it was well established.
from openapi-client.
Fair enough @mikestead . As you say, adding middleware to inspect all actions for errors is a good idea. I'll run with that. Cheers
from openapi-client.
The middleware/api actions in the official real world Redux example uses the _REQUEST
, _SUCCESS
and _FAILURE
pattern. For my part I think this is more idiomatic Redux / best practice than the FSA format, which I haven't really seen get wide spread adoption in the wild.
https://github.com/reactjs/redux/blob/master/examples/real-world/src/actions/index.js
Just my 2 cents worth :)
from openapi-client.
Hey @mikestead I only just noticed @jedrichards comment. This is basically my feeling as well. I appreciate the FSA approach, but I think the idiomatic Redux approach would be more suitable.
How about a CLI flag for the action type? Obviously this is a major change, but something like --action-type=FSA
or --action-type=redux
would be pretty sweet.
from openapi-client.
@shankie-san @jedrichards Thanks for the feedback. Yeah a flag to opt into it sounds good. I'll reopen the ticket.
I'd probably want to keep the current default to be backwards compatible. Don't have time to look at this anytime soon I'm afraid.
from openapi-client.
Related Issues (20)
- File upload missing HOT 1
- Outdir is relative to package.json, rather than the file HOT 2
- Request: docs on using generated code, in particular, auth HOT 6
- Custom authorization header
- Certain POST configurations result in an action creator that doesn't work
- Customizing the output of redux actions HOT 2
- Properties are not type checked for propLines constant
- Buffer polyfill being compiled into Webpack client bundles HOT 1
- Cannot convert undefined or null to object HOT 1
- Generator is lacking sanitization of identifiers
- redux action params are not converted to camelCase HOT 1
- Optional `date` parameter throws error HOT 2
- Make fetch'es 'credentials option' avail. HOT 3
- Dot (.) in function and parameter name. HOT 1
- parameter name with '.' HOT 1
- Problems with dash (-) in url HOT 1
- Usage with Angular2 HOT 1
- Only expose interfaces and types
- The models are also generated ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-client.