All Questions
Tagged with immutable.js node.js
18 questions
0
votes
1
answer
239
views
Redux unexpected behaviour | create empty object if not found
I am debugging an app, there is an existing redux reducer which sets some data of store object. Now when i dispatch action for this reducer before the relevant object is initialised it still works and ...
0
votes
1
answer
136
views
Why is the wrong Immutable.js Map factory function selected when running npm test?
I get a compiler error when I run npm test after I make a Map with the factory function that consumes the 'collection' argument (see https://immutable-js.github.io/immutable-js/docs/#/Map/Map). There ...
0
votes
0
answers
546
views
Immutable.js - Passing ReferenceError: Map is not defined
I just found out about immutable.js.
I want to play around with it, get used to how it works.
Really simple. Don't even need to write code, just futzing with
it in the node shell interactively.
I ...
0
votes
0
answers
231
views
Create object where every property and subproperty is only writable once
Is there a way to create an object with Javascript, where every property on the object is only writable once, and not modifiable after first write?
All I can of is a proxy object, that has hooks on ...
0
votes
0
answers
596
views
How to do server side rendering with Redux + Immutable js?
I would like to Use Immutable js with my App .But It's Kinda difficult for server side rendering It throws me a error like this
TypeError: state.allPosts.toJS is not a function
Home.js
import React,...
1
vote
2
answers
435
views
ImmutableJS: Upating an object inside an array of arrays
I have a somewhat complex state as follows:
array:
array:
object,
object,
etc...
array:
etc...
Simply put, an array containing a number of arrays that hold objects.
I am trying to ...
0
votes
1
answer
450
views
Merging two pieces of mismatching data with immutable.js?
I have a piece of JSON data that I use to dynamically generate a form and it looks like so:
{
"form": {
"fields": [
{
"name": "First Name",
"alt": "first_name"
},
...
0
votes
1
answer
72
views
How to use lodash as helper for the following code
I use the following code which is working and I wonder if there is a way to make it simple using lodash or other lib?
I'm getting array with value and add it line by line and this is just the ...
1
vote
0
answers
226
views
Hashing Function for HashMap
I'm working on a library that implements a lot of data structures, and I'm making it mostly for learning purposes because I want to learn more about data structures. I'm implementing HashMap at the ...
1
vote
1
answer
96
views
Immutablejs Map.update breaks unit tests
I'm trying to pick up Redux and the tutorial I am following uses ImmutableJs. I am totally new to ImmutableJs and am just going by the API documentation to get going. My practice app is much more ...
1
vote
2
answers
639
views
Redux & Immutable.js - set state from json
my reducer
var initialState = Map({
status: true
});
function user(state = initialState, action) {
switch (action.type) {
case GET_PROFILE:
return state.set(fromJS(action.response))
}
...
18
votes
1
answer
18k
views
Redux React create initial state from API
How to define initialState from API?
Actions
import * as types from '../constants/ActionTypes'
import jquery from 'jquery'
import { apiRoot } from '../config.js'
import Immutable from 'immutable'
...
0
votes
1
answer
3k
views
How to render the React component with dynamic data realtime from socket.io high efficiency
My front-end page is made by React + Flux, which sends the script data to back-end nodejs server.
The script data is an Array which contains the linux shell arguments (more than 100000). When to back-...
2
votes
2
answers
955
views
ImmutableJS fromJS() and Map() "ownerID" doesn't match
I am using chai-immutable npm module for testing. Here is the test:
it("runs the test", () => {
const initialState = Map();
const entries = ["entry"];
const nextState = setEntries(...
0
votes
1
answer
585
views
TypeError: 'MyClass.MyFunction is not a function' error message in ES6 / Node 4
I am facing a bug which I can replicate with the following piece of code in a node.js 4.0 application:
"use strict";
var Immutable = require("immutable");
class AspectType {
constructor(...