Comments (7)
Seems interesting, but how do you handle *
as, real key?
from immutable-js.
maybe that would need extra functions, e.g. setAll, deleteAll,... or a matcher function. On the other hand, it's proabably easier to just do forEach
with set
than that, I imagine merging all the changes across multiple layers in one go would be difficult
from immutable-js.
Seems interesting, but how do you handle
*
as, real key?
What if we use come object type or constant value instead of plan string there?
For example predefined ANY
type const any = {};
so path looks like [any, 'c', 'a']
from immutable-js.
On the other hand, it's proabably easier to just do forEach with set
In case we have nested structure where array or map elements have similar structure, it becomes too cumbersome to write such update methods with forEach
and Set
.
Each *
replace one one nested forEach
.
Say we want to delete people's sensitive data when authenticated user signs out, so no sensitive data is displayed on the site page. If user is nested structure and we have something like city -> street -> house -> user
then we will end up having 4 nested update functions, where the syntax with wildcard will be pretty expressive ['*', '*', '*', 'user', 'email']
from immutable-js.
After some though, it may be possible to inject a RegExp object in the path. What do you think?
from immutable-js.
After some though, it may be possible to inject a RegExp object in the path. What do you think?
Yes, this is a good idea and provides even more flexibility
from immutable-js.
RegEx could be keys too. Having a Map or Set with RegEx keys is unlikely, but not impossible.
The problem with existing functions is, that anything can be a key. The "ANY" special constant would work, but might be clunky
from immutable-js.
Related Issues (20)
- Converting a Seq to a list causes RangeError (max call size exceeded) HOT 1
- 4.2.0: partition missing in flow HOT 3
- Question: Wiki article for upgrading to v4 HOT 3
- `toJS` breaks type compatibility between records with object values HOT 8
- Wrong typescript declarations for `.update()` method (continued) HOT 2
- Record with more keys should be assignable to Record with less keys if type is a subset of the first one
- An argument for 'reviver' was not provided. HOT 4
- ReferenceError: Immutable is not defined HOT 9
- Highlight inputs where `Set` can't maintain uniqueness HOT 4
- Flow type definition outdated, not working with last year changes HOT 1
- Urgent: Package Installation Reveals Multiple Vulnerabilities HOT 1
- Type predicate missing on isOrderedSet function type declaration
- support deno HOT 2
- immutable default import in 5.x
- version 4.3.3 breaks TS/Angular/webpack HOT 2
- Typescript: Implement `MapOf::merge `
- Extract sort function from Collection types HOT 6
- Enhancement: Custom equals HOT 8
- Strange edge case with Map.update(...) HOT 3
- Moving off deprecated dependencies HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immutable-js.