![](/img/trans.png)
[英]How to extract mutable object type from immutable object type
我需要創建從現有的不可變對象類型中僅提取可變對象類型的類型: 所以問題出在getMutable 。 Typescript不檢查它是否會再次返回可變或不可變對象,因此我需要強制TS對此進行驗證,如果返回不可變對象,則會引發錯誤。 這個怎么做? ...
[英]How to extract mutable object type from immutable object type
我需要創建從現有的不可變對象類型中僅提取可變對象類型的類型: 所以問題出在getMutable 。 Typescript不檢查它是否會再次返回可變或不可變對象,因此我需要強制TS對此進行驗證,如果返回不可變對象,則會引發錯誤。 這個怎么做? ...
[英]'state.merge is not a function' in react-native
在我的react-native應用程序中,如果用戶處於脫機狀態,我正在使用redux-persist來顯示商店中存在的數據。 但是在添加redux-persist之后,我得到了錯誤state.merge is not a function 。 我認為這是不變性的錯誤。 請幫助我解決這個問題 ...
[英]how to sort Immutable data
我在redux中使用'seamless-immutable'。 但是我遇到了無法對數據進行排序的情況。 //減速器 我正在獲取數據,但是當我嘗試排序時,例如:(say)arr.sort,它給了我:無法在不可變數據結構上調用sort方法。 如何排序數據? 謝謝您的幫助。 ...
[英]Append/push in seamless immutable js - react js
在Reducer的初始狀態中,我使用的是無縫不可變的。 如何將新數據推入foo? ...
[英]What is the preferred method for setting the value of a Seamless Immutable Array?
Seamless Immutable Object的文檔已set為更新對象中鍵的值,但是在Immutable Array文檔中,沒有用於更新數組元素的set 。 設置Seamless Immutable Array的值的首選方法是什么? ...
[英]React reducers & seamless-immutable
我是減速器和不變事物的新手,所以也許有人可以回答我一些問題。 我使用無縫不可變的( https://github.com/rtfeldman/seamless-immutable )與終極版-seammless-不可變的(沿https://github.com/eadmundo/redux-s ...
[英]seamless-immutable is not updating state consistently
我正在使用Seamless-immutable和redux,並且在更新狀態時遇到一個奇怪的錯誤。 這是我的代碼,沒有動作return或CombineReducers之類的內容。 只是正在運行/導致錯誤的垃圾。 初始狀態 動作處理程序 中間件 現在,很奇怪的是,如 ...
[英]seamless-immutable array property is not immutable
我想知道是否有一種方法可以使用無縫不可變來轉換對象,其中結果不可變的數組屬性也是不可變的,目前 我想要的是ia.hey,也是一個不變的數組,有人知道怎么做嗎? ...
[英]How to forbid a specific named function with ESlint
情況 在我們當前的項目中,我們遇到了一些反復出現的問題,人們在無縫不可變的情況下使用“asMutable”,但實際上並不需要。 這導致“字符串“asMutable”的搜索項目”成為每個拉取請求的一部分。 為了加快速度,我們想在我們的 eslint 中添加一個規則警告。 但我還沒想好怎么做。 問題 ...
[英]Remove element from nested redux state
我想從我的redux狀態中刪除一個元素。 我使用seamless-immutable及其API來操作狀態。 但是當狀態嵌套時,我找不到任何漂亮的方法來刪除元素。 所以我要刪除的元素是: state.shoppingcartReducer.products[articleNr] 謝 ...
[英]map array of objects into map grouped by object key js immutable
我想將一個對象數組映射到輸出按特定對象鍵分組的不可變映射。 使用 immutablejs 或無縫不可變的最有效方法是什么? 目前我使用 reduce 為: 這個輸出 byIds 是我想要的,但是byTime問題是我需要合並而不是覆蓋。 我嘗試使用無縫不可變我做了: ...