Comments (3)
You can still use immutable data structures without ngrx. It makes programming this easier. Use the “immer” library, it’s only like 2kB. The morphing quiz example does this, I believe.
As for hover, the way it’s implemented in the examples with immutable lists is that you have to produce a new version of the list-of-lists. To preserve cancel-ability, you keep the old one around, and it simplifies things to implement hover with the same code that moves things for real, because the requirements of hover are pretty much identical to moving:
- a normal move, usually done in
drop
that takes the old list-of-lists and moves the card, producing a new list-of-lists - a hover, which takes the old list-of-lists and moves the card to exactly the same place (“under the mouse”), producing a new list-of-lists
You don’t have to do that, you could always just “move it back” to cancel, but cancelling is way easier when you do it this way.
I’m not going to code up what it looks like when you just mutate lists in flight, because it’s painful and frankly a waste of time. If any clojure developers looked at Dragula/ng2-dragula and this list-mutating madness, they would have to put their spaceships on autopilot for a moment to fall over laughing. Yes it could be done, but save yourself the trouble.
from angular-skyhook.
Thanks for getting back to me so quickly. I'll give Immer a shot today, and hopefully save myself a headache and learn something as well.
Also, I notice Immer's readme has a button for buying the developer a coffee to say thanks. I don't know how you feel about asking for donations, but some of us do like to thank the good people like you who make our lives easier with these public projects.
from angular-skyhook.
@killface looks like I thought about it 8 months ago but never added a button. It's a good idea.
Hope you figured out your thing.
from angular-skyhook.
Related Issues (20)
- Skyhook 1.2.1 seems to cause a script error with Angular 8 and Edge browser. HOT 4
- bug: type error in `@angular-skyhook/multi-backend` 1.2.1 HOT 8
- SkyhookPreview out of position
- Running ng build with optimization set to true breaks this library HOT 7
- Simple sortable freeze on drop HOT 4
- Can skyhook support nested sortable lists HOT 7
- backend.backend is not a constructor HOT 6
- wrong offset in preview in chrome with win10 scaling on HOT 4
- Single backends do not work in 1.3.0 HOT 8
- Providing options is not working yet
- ivy runtime error HOT 26
- inject() must be called from an injection context HOT 1
- Multiple Drag and Drop HOT 3
- working with iframe?
- peer dependency for 1.4.0.rc-0 not updated in multi-backend
- Library breaks when enabling optimizations on Production, on v1.3.3
- skyhook-preview: binding style template via async pipe causes unnecessary change detection HOT 1
- "Cannot find namespace 'NodeJS'" and Module '"../../node_modules/react-dnd-html5-backend/lib"' has no exported member 'default'.
- Are you happy to add me as a contributor to fox the library? HOT 3
- ERROR Error: inject() must be called from an injection context
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 angular-skyhook.