Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Persistent data structure
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== JavaScript === {{Confusing section|date=May 2021}} The popular JavaScript frontend framework [[React (JavaScript library)|React]] is frequently used along with a state management system that implements the [[Flux architecture]],<ref>{{Cite web|url=https://facebook.github.io/flux/|title=Flux {{!}} Application Architecture for Building User Interfaces|website=facebook.github.io|access-date=2018-10-23}}</ref><ref>{{Cite web|url=https://medium.com/react-ecosystem/how-to-handle-state-in-react-6f2d3cd73a0c|title=How to handle state in React.|last=Mora|first=Osmel|date=2016-07-18|website=React Ecosystem|access-date=2018-10-23}}</ref> a popular implementation of which is the JavaScript library [[Redux (JavaScript library)|Redux]]. The Redux library is inspired by the state management pattern used in the Elm programming language, meaning that it mandates that users treat all data as persistent.<ref>{{Cite web|url=https://redux.js.org/|title=Read Me - Redux|website=redux.js.org|access-date=2018-10-23}}</ref> As a result, the Redux project recommends that in certain cases users make use of libraries for enforced and efficient persistent data structures. This reportedly allows for greater performance than when comparing or making copies of regular JavaScript objects.<ref name=":0">{{Cite web|url=https://redux.js.org/faq/immutabledata|title=Immutable Data - Redux|website=redux.js.org|access-date=2018-10-23}}</ref> One such library of persistent data structures Immutable.js is based on the data structures made available and popularized by Clojure and Scala.<ref>{{Cite web|url=https://facebook.github.io/immutable-js/|title=Immutable.js|website=facebook.github.io|access-date=2018-10-23|archive-url=https://web.archive.org/web/20150809185757/http://facebook.github.io/immutable-js/|archive-date=2015-08-09|url-status=dead}}</ref> It is mentioned by the documentation of Redux as being one of the possible libraries that can provide enforced immutability.<ref name=":0" /> Mori.js brings data structures similar to those in Clojure to JavaScript.<ref>{{Cite web|url=https://swannodette.github.io/mori/|title = Mori}}</ref> Immer.js brings an interesting approach where one "creates the next immutable state by mutating the current one". <ref>{{Cite web|url=https://github.com/immerjs/immer|title = Immer| website=[[GitHub]] |date = 26 October 2021}}</ref> Immer.js uses native JavaScript objects and not efficient persistent data structures and it might cause performance issues when data size is big.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)