Iam new to react. I have been reading Alt.js and flux architecture since few days. Few conceps I am not able to understand. From a component we access store and get the data. If it is server side request we have async Data Sources which is binded to the store through this.registerAsync(). Any POST or GET request made to the server are all written in Data Source file and the response is handled in the store. So what is the necessity of actions I see actions file as just a dummy file which useless connects source and store or component and store. Rather can't we remove action and directly send response to store from source or from the component ?
What is the necessity of actions in Alt.js
214 Views Asked by K2A At
1
There are 1 best solutions below
Related Questions in REACTJS
- ussd reader in Recket Native module
- Teams tab application returns SSO error in mobile Outlook
- Github Pages Deployment deploys a blank page
- Is there any way to glow this bulb image like a real light bulb
- Optimize LCP ReactJs
- Page in React only renders elements after refreshing
- Unable to Post Form Data to MongoDB because of picturepath
- MERN Stack App - User Avatar Upload - 500 Error After Deployment on Render
- Hooks are not supported inside an async component error in nextjs project using useQuery
- How to change the Font Weight of a SelectValue component in React when a SelectItem is selected?
- On the server side, it returns undefined but on the client side, logs the values no problem
- Multilevel dropdown with checkboxes in Select component
- TypeScript Error only on big type only when assigned to a variable
- Deployment through app engine, cloud sql database, problem connecting with server code, doesn't connect
- Data is not filtering in props. Showing passdata.map is not a function
Related Questions in FLUX
- Is there a way to apply backpressure to the whole pipeline of fluxes?
- How can I send data from influxdb to MQTT?
- I have the following error in Telegraf when sending data from influxdb to mqt
- How to add consumer to Flux publisher on first api call
- Influxdb not sorting by time (cannot group float and string types together)
- Set date and time in the RANGE PARAMETER in InfluxDB
- Update helm Release on changes to values file
- Spring webflux not streaming instead gives response after the processing is complete
- Trying to create a stream (Flux) of strings with create method but it doesn't work
- Why doesn't the loss calculated by Flux `withgradient` match what I have calculated?
- freeze layer parameters in Flux.jl alternative
- is there kustomize version used by flux kustomization
- Blue/Green Deployments for Monolith Application w/Multiple Kubernetes Deployment Manifests
- How can I change the bandpass filter of fluxes/magnitudes to a synthetic filter?
- Trunk based branching and deploying into multiple environments
Related Questions in ALT.JS
- Is calling another action in store listener an anti-pattern for Flux?
- What is the necessity of actions in Alt.js
- Is setState() optional for updating the state in Alt.js store?
- Listen for a specific Store property change
- React/Alt - avoid dispatching within a dispatch when responding to user input?
- Having trouble accessing React actions in isomorphic application
- When to use dispatch with alt.js flux
- Disable and re-enable button on single action
- Reactjs/Flux/altjs Listen for Store Changes slow down app
- react, react-router, and async data loading
- How much state does really belong in the stores?
- How to handle data dependencies with Async in Alt.js
- React + Alt: Use data from multiple stores to make a request to DataSource
- How to update state after successful request with sources in alt.js?
- May I use alt stores in multiple components in react?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
We personally used NuclearJS (another flux implementation similar to one you use) and had the same question for a long time.
It is not a necessary thing. Redux does not have
actionsfor example.After building a large application using NuclearJS we have a internal rule for how to use actions and we found them rather useful. Imagine you have a form that on its change you are going to get new records and update the records list in store, update form values and also change a isLoading state till we completely updated the list by new records. Here you can create an action that dispatches 3 times for each of the updates above.
Also for actions that were only dispatching their corresponding store, we added a wrapper api that whenever an action was a 'delegateToStore' string (not a function) that api calls the store directly, and we just write
'delegateToStore'in our actions.Finally you don't even need a store unless your app is complicated enough, I suggest that you start with a simpler flux like library like redux and gradually move to complicated solutions (like relay, etc) as your application becomes much more (Facebook scale!) complicated.