All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.withImmutableActions.withImmutableActions.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"withImmutableActions.js","names":["_ramda","require","setWithoutModifyingActions","set","partial","previous","overwrittenActions","keys","filter","key","isEmpty","Error","concat","join","withImmutableActions","config","get","api","_default","exports"],"sources":["../../../../src/react-utils/withImmutableActions/withImmutableActions.js"],"sourcesContent":["import { isEmpty, keys } from \"ramda\";\n\nconst setWithoutModifyingActions = set => partial =>\n  set(previous => {\n    if (typeof partial === \"function\") partial = partial(previous);\n\n    const overwrittenActions = keys(partial).filter(\n      key =>\n        typeof previous?.[key] === \"function\" && partial[key] !== previous[key]\n    );\n    if (!isEmpty(overwrittenActions)) {\n      throw new Error(\n        `Actions should not be modified. Touched action(s): ${overwrittenActions.join(\n          \", \"\n        )}`\n      );\n    }\n\n    return partial;\n  }, false);\n\nconst withImmutableActions = config => (set, get, api) =>\n  config(setWithoutModifyingActions(set), get, api);\n\nexport default withImmutableActions;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAGC,GAAG;EAAA,OAAI,UAAAC,OAAO;IAAA,OAC/CD,GAAG,CAAC,UAAAE,QAAQ,EAAI;MACd,IAAI,OAAOD,OAAO,KAAK,UAAU,EAAEA,OAAO,GAAGA,OAAO,CAACC,QAAQ,CAAC;MAE9D,IAAMC,kBAAkB,GAAG,IAAAC,WAAI,EAACH,OAAO,CAAC,CAACI,MAAM,CAC7C,UAAAC,GAAG;QAAA,OACD,QAAOJ,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGI,GAAG,CAAC,MAAK,UAAU,IAAIL,OAAO,CAACK,GAAG,CAAC,KAAKJ,QAAQ,CAACI,GAAG,CAAC;MAAA,CAC3E,CAAC;MACD,IAAI,CAAC,IAAAC,cAAO,EAACJ,kBAAkB,CAAC,EAAE;QAChC,MAAM,IAAIK,KAAK,uDAAAC,MAAA,CACyCN,kBAAkB,CAACO,IAAI,CAC3E,IACF,CAAC,CACH,CAAC;MACH;MAEA,OAAOT,OAAO;IAChB,CAAC,EAAE,KAAK,CAAC;EAAA;AAAA;AAEX,IAAMU,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAGC,MAAM;EAAA,OAAI,UAACZ,GAAG,EAAEa,GAAG,EAAEC,GAAG;IAAA,OACnDF,MAAM,CAACb,0BAA0B,CAACC,GAAG,CAAC,EAAEa,GAAG,EAAEC,GAAG,CAAC;EAAA;AAAA;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAErCL,oBAAoB","ignoreList":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy