Questions tagged [reducers]

Refers to reducers in the mapreduce framework. Mappers split up a large problem and solve parts of it in parallel. Reducers collect and summarize the output of a map method.

Reference: https://en.wikipedia.org/wiki/MapReduce

819 questions
5
votes
2 answers

combineReducers destroys Redux state and also breaks multi ImmutableJs reducers

Banging my head on this. I've blown through the typical ReactJS and Redux app tuts and am working on my own app. The problem is when using combineReducers() to create a single reducer for the Redux store. I currently have three reducers which, on…
DaneTheory
  • 282
  • 3
  • 16
5
votes
1 answer

Add property reducer redux

I wan't to add a property sections: [] to my object formOpen in the reducer, I receive my object formOpen from my server with other properties and I want to add this one, how can I do that here ? Thanks import { combineReducers } from 'redux' import…
fandro
  • 4,833
  • 7
  • 41
  • 62
5
votes
1 answer

Composing reducers with nested array

I'm using Redux for a while now and I'm loving it :) I'm a bit confused on how to compose reducers when dealing with nested arrays. I've a user object, which has a list of reviews. Each review can have a list of review_comments. { user: { id:…
skmvasu
  • 3,098
  • 3
  • 24
  • 29
5
votes
2 answers

Clojure Performance, How to Type hint to r/map

Below, I have 2 functions computing the sum of squares of their arguments. The first one is nice and functional, but 20x slower than the second one. I presume that the r/map is not taking advantage of aget to retrieve elements from the…
Scott Klarenbach
  • 37,171
  • 15
  • 62
  • 91
5
votes
1 answer

What is Ideal number of reducers on Hadoop?

As given by Hadoop wiki to calculate ideal number of reducers is 0.95 or 1.75 * (nodes * mapred.tasktracker.tasks.maximum) but when to choose 0.95 and when 1.75? what is factor that considered while deciding this multiplier?
sagar
  • 1,375
  • 5
  • 20
  • 38
5
votes
1 answer

Job and Task Scheduling In Hadoop

I am little confused about the terms "Job scheduling" and "Task scheduling" in Hadoop when I was reading about delayed fair scheduling in this slide. Please correct me if I am wrong in my following assumptions: Default scheduler, Capacity scheduler…
GoT
  • 530
  • 1
  • 13
  • 35
4
votes
4 answers

Destructing default state in redux reducer

What is the difference in returning state in default case in redux reducer between return state and return { ...state } ?
Paweł Baca
  • 814
  • 2
  • 15
  • 28
4
votes
2 answers

What is a foldable collection in Clojure?

I am beginner to Clojure, while trying to read about Reducers I found something called foldable collection. They are mentioning that vectors and maps are foldable collection, but not the list. I am trying to understand what is foldable collection,…
SANN3
  • 9,459
  • 6
  • 61
  • 97
4
votes
2 answers

Property id does not exist on type 'never'

I'm trying to do a .map function into a state array in Redux with Typescript, the problem is that it's throwing an error [ts] Property 'id' does not exist on type 'never' in the landing.id if statement, since its an array of objects the code…
Lucas Janon
  • 1,502
  • 1
  • 15
  • 18
4
votes
0 answers

How to write the jsDoc for the reducer in reactjs?

I have the reducer for our component, we are following jsDoc for the documentation.But in reducer how can I cover the Switch case of reducer in document.My code and comment right now is like this:- // first import the constant import { …
Gorakh Nath
  • 9,140
  • 15
  • 46
  • 68
4
votes
0 answers

Data transformation in Class vs Reducer (ngrx/redux)

Using ngrx/redux, and following the ngrx example app as close as possible. Now I'm doing this somewhere in the application: get totalItems (): number { return sumBy(this._data.items, 'metadata.value'); } Where the _data is the raw async data…
TrySpace
  • 2,233
  • 8
  • 35
  • 62
4
votes
1 answer

Converting API data in React-Redux: Action or Reducer

I have a weather app that the api data comes in different formats so I made up an object of methods the I can convert that data to imperial format and time from UTC to GMT. Right now I have those methods being called on the data in my…
rockchalkwushock
  • 1,143
  • 2
  • 9
  • 19
4
votes
2 answers

Update List via Redux's Reducer

I am making a small recipe list for learning purposes on React (since I am new to it). I was able to figure out how to ADD and DELETE recipes from the list. However I am hard time how to EDIT a recipe from the list (App's state). Following from…
Alejandro
  • 2,266
  • 6
  • 35
  • 63
4
votes
2 answers

Reducer, Mapreduce, does not show error, but does not give desired output

Sales Driver class package mr.map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import…
4
votes
1 answer

How to return state of Redux reducers

For redux reducer step : What if I only want to change one single property of initial_state. For example: const INITIAL_STATE = { signInInfo: { signin: false, name: "", email: "", ... }, changePassword: { status:…
user6557921
  • 55
  • 1
  • 3