Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
68 views

I created a selector of users in a group in my immutable redux state: import { useStore } from 'react-redux'; import { createSelector } from '@reduxjs/toolkit' const selectGroup = (state) => state....
user2456977's user avatar
  • 3,964
2 votes
1 answer
110 views

To clarify: This is nominally about Immutable.js' Map/OrderedMap, though the essence of the question is general to any TypeScript API (/structurally typed language). I think I understand technically ...
Niki Herl's user avatar
  • 538
0 votes
2 answers
176 views

I am using Typescript 5.3.3 and I have reducer code that generates ts(2345) errors. The reducer looks like this: const initialState = Immutable.fromJS({ isLoading: false, }) const myReducer = (...
Clutchplate's user avatar
0 votes
1 answer
66 views

Immutable comes with the fromJs function that transforms a regular nested data structure to an immutable one. My problem is that I can't get it to work nicely with Typescript. This is what I have: ...
Adam Arold's user avatar
  • 30.8k
0 votes
1 answer
460 views

After upgrading our Typescript and Immutable libraries, I am seeing the error Object is possibly 'undefined'.ts(2532) in many places across our codebase even when there is an undefined check prior to ...
Adam Cramer's user avatar
0 votes
0 answers
297 views

Here is a mock of what I have tried with each outcome... I've read over the documentation and it seems like at least some of these things should work. Not sure what I'm doing wrong. function getMatch( ...
tomtom's user avatar
  • 3
1 vote
1 answer
243 views

I'm currently working with a combination of Redux, Immutable.js, and TypeScript. I'm having trouble getting proper types from the useSelector hook, and I've resorted to using type assertions. I ...
userK's user avatar
  • 11
0 votes
1 answer
176 views

I am testing my redux saga method using jest. I am facing some issues. Attaching the saga method, test case & the console response. Let me know where I missed it. Tried lots of googling. But ...
Rahul Mangal's user avatar
1 vote
2 answers
2k views

I've been breaking my head for a week or something with this !! My redux state looks similar to this { data: { chunk_1: { deep: { message: "Hi" } }, ...
Hard Code Programmer's user avatar
0 votes
1 answer
64 views

case 'MODIFY_NODES': { if (action.payload.nodes) { for (const node of action.payload.nodes) { const setNodes = action.payload.nodes.filter(n => state.findIndex((item) => ...
user avatar
0 votes
1 answer
278 views

I am trying to grab data from an array of objects called "nodes". I've console logged: console.log(props.mapValues.get('entries')) to grab the object but it returns an array length of 0. ...
Colorful Codes's user avatar
0 votes
0 answers
44 views

What are the advantages of using immutable libraries like immer.js or immutable.js? What is the difference between making changes to a draft of an object or making changes to a duplicate of the ...
A. J. Green's user avatar
2 votes
2 answers
647 views

I am trying to grab the 'message' value but it is returning undefined when I use this: console.log('message: ', props.information.getIn(['_root', 'entries'])) To console log the data below I use this ...
Colorful Codes's user avatar
0 votes
1 answer
269 views

With the release of Immutable v4, there has been some api changes. toJS(): any became toJS(): {[key: string]: unknown} From what I understand it has been replaced by toJSON() but what's the difference ...
Matthieu Riegler's user avatar
0 votes
2 answers
934 views

I have a value events which is a list of lists with maps that look like this: [ [ { "packageId": "2721", "eventTime": "2022-03-...
Ludwig's user avatar
  • 1,881
2 votes
3 answers
181 views

I have a value events of a type Map<number, List<Event>>, I am flattening this value like this: const flatEvents = events.valueSeq().flatMap(event => event.values()).toList() The value ...
Ludwig's user avatar
  • 1,881
0 votes
1 answer
1k views

I have a value shipments that is of a type Map<number, Shipment>, Shipment has a property packageIds which is of a type Set<number>. When I have multiple shipments I would like to go ...
Ludwig's user avatar
  • 1,881
0 votes
0 answers
1k views

I have an object that may contain children of the same type of object, potentially making it infinite nested. { command: Yup.string(), children: [ { val1: Yup.string()...
Thaya's user avatar
  • 1
0 votes
0 answers
141 views

Here is my function. export class GetPipe { public transform<K, V>( list: | Array<V> | List<V> | Map<K, V> | ...
Matthieu Riegler's user avatar
0 votes
1 answer
231 views

I'm working on a project that consumes data from the Nasa Mars Rover api and keeps it in a store with Immutable.js store. The data is correctly updated in the store, and i'm able to access the data ...
Evan Parker's user avatar
1 vote
0 answers
1k views

I want to receive this JSON form from the server and add it automatically in the dialog. I want to automatically show the input item coffee, 15... in the dialog. Q1) I want to delete it only when I ...
hellojohnwoo's user avatar
0 votes
1 answer
61 views

I have a piece of code that looks like this const { Map } = require('[email protected]') let map = new Map().setIn(["user",["alex","country"]],"Poland") map....
Ndifreke's user avatar
  • 784
0 votes
2 answers
119 views

I have an immutable.js Map stored in Redux that is structured like: reduxObject: { details: {} ... objectToChange: { myPosts: [{ name: 'someName', link: 'someLink', ...
Say u's user avatar
  • 139
-1 votes
1 answer
291 views

I have created an immutable map and am currently using it with redux and i have some general questions about immutability. From what I understand, when passing props down to a component the props do ...
Say u's user avatar
  • 139
1 vote
2 answers
2k views

I got this typing error when trying to use immutable js reviver from fromJS function. Check this TS playground, I could reproduce it there. interface User { name: string; age: number; } // Taken ...
deerawan's user avatar
  • 8,503
0 votes
1 answer
99 views

Just curious, what is the time complexity for Immutable.JS's deleteIn? In the documentation, it says that gets and sets are O(log32 N) for immutable.Map. Assume that we are not deleting from an array, ...
databasechaser's user avatar
0 votes
1 answer
54 views

I have code that looks similar to this const attr = event.target.value; const query = filter.merge({ [attr]: !filter[attr] }); where filter is a Immutable Record. Flow complains because an index ...
DPA's user avatar
  • 164
1 vote
0 answers
159 views

I have a nested Immutable.Map of Immutable.Map type defined as follows: export type Data = Immutable.Map<string, Immutable.Map<string, string>>; const nested : Data = Immutable.Map(); ...
injoy's user avatar
  • 4,423
1 vote
0 answers
928 views

I am using next.js immutable Js and redux saga. Error: Error serializing .initialState.ui returned from getServerSideProps in "/me/profile-setting". Reason: object ("[object Object]&...
Ameed Faridi's user avatar
0 votes
0 answers
363 views

I have a fetch request where I am getting a data object that has an items array in it. export const getItems = (searchString: string, limit?: string, offset?: string) => (dispatch: ThunkDispatch) =&...
Leff's user avatar
  • 1,610
2 votes
4 answers
180 views

I'm working with React/Redux and want to use the same Promise result to set two different states. Here's my code: useEffect(() => { fetchData().then((resp) => { Object.freeze(resp); ...
mmz's user avatar
  • 1,151
1 vote
1 answer
6k views

In my project(Next.js v10), the immutable library is used to work with redux. Now I tackled the issue of optimization, because I ran into the problem of "red" first load js. I am not very ...
Roman Nozhenko's user avatar
1 vote
1 answer
161 views

I have below a piece of code wherein I need to push a new Immutable Map value to an Immutable List on each forEach iteration. The flow goes into if condition as expected, but nothing is being pushed ...
Shantanu Tomar's user avatar
1 vote
2 answers
920 views

I have 2 Immutable Object. and the structure is like below const state = fromJS({ "a":"value1", "b":{ "c":"value2" ...
Bishal Jain's user avatar
0 votes
1 answer
926 views

I am trying to represent a tree-like data structure using immutable js and typescript. Right now, I am using normal vanilla js objects to represent the nodes in the tree. Here is the type signature. ...
Leo Ware's user avatar
  • 119
0 votes
3 answers
211 views

I have the following structure in the project im working on (uses immutable JS): data :[{name: 'john', surname: 'smith', children: [{name: 'sam'}, {name: 'ben'}]}, {name: 'jane', surname: '...
sheeni's user avatar
  • 417
0 votes
2 answers
1k views

I am using redux to persist state for a React.JS app. The state keeps objects named event, which look-like {id: 2, title: 'my title', dates: [{start: '02-05-2021', end: '02-05-2021'}] } hashed by ...
Igor Shmukler's user avatar
0 votes
2 answers
115 views

I have this declaration: const players = immutable.fromJS({ enabled: true, contract, }) and I have a checkbox that basically toggles the enabled to true/false. I also have 'Enabled All' ...
ajbee's user avatar
  • 3,651
0 votes
2 answers
159 views

Immutable.List does not seem to prevent you treating it as a mutable array: const Immutable =require( 'immutable'); const l = Immutable.List([1,2,3,4,5]); l[4] = 9; console.log(l[4], l.get(4)) // ...
Steve Bennett's user avatar
0 votes
1 answer
371 views

I'm not sure why but I'm getting an error when I'm trying to import 'RecordFactory' from immutable.js: The error is: Module '"immutable"' has no exported member 'RecordFactory'.ts(2305) Env:...
Shira's user avatar
  • 424
0 votes
2 answers
568 views

const [fieldValues, updateFieldValues] = useState(fromJS({ imageName: '', tags: [], password: '', })); const handleButtonClick = () => { const res = // logic to find which field/...
noobBokhonto's user avatar
0 votes
1 answer
243 views

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 ...
Shujaat Ali's user avatar
1 vote
2 answers
718 views

I've been working with Immutable JS for a few months. And I really like the functionality it gives. But I've been doing something I don't like over and over again. It has to do with retrieving a value ...
Steven Soekha's user avatar
0 votes
2 answers
38 views

This is my Product [ { "quantity": 8, "size": "S", "product": { "_id": "607283d971fbe12de4e42ebe", "title&...
Waqas Ahmad's user avatar
1 vote
1 answer
568 views

I'm having a hard time refactor my reducers to TS since I'm using Immutable.js in my project This is my reducer: export interface DashboardState { componentId: number | null; dashboard: number | ...
Shira's user avatar
  • 424
0 votes
1 answer
54 views

I would like to use immutable.js, and see that v4.0.0 is at rc.12. That version string seems to indicate that v4.0.0 is not yet released. Is that because there is a problem with v4.0.0, and we should ...
John's user avatar
  • 1,361
0 votes
1 answer
154 views

I have this type: type Route<A> = [A] | [A, A] | [A,A,A] So when I define routes like this: const r: Route<number> = [1,2], r2: Route<number> = [1,2]; and I put them in a set: ...
eguneys's user avatar
  • 6,490
0 votes
1 answer
408 views

My state consists of settings selected by a user to view charts in the application. Each time a user logs in I get their respective settings from the database. I also have an initial state defined in ...
harshvardhan.agr's user avatar
0 votes
1 answer
118 views

In typescript I can define an array of a number and string like this: type A = [number, string] I decided to use Immutable.js now how do I define this type using an Immutable List. Something like ...
eguneys's user avatar
  • 6,490
0 votes
1 answer
319 views

immutable.js has a Set object, and you can find the intersection of two sets via set1.intersect(set2), but what if I have an arbitrarily long array of sets [set1, set2, set3, set4,...] and I want to ...
Cypress Frankenfeld's user avatar

1
2 3 4 5
25