Git Product home page Git Product logo

elm-debounce's People

Contributors

mpizenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elm-debounce's Issues

Rename package for elm 0.19

There are currently a lot of packages called elm-debounce or similar.

It's hard to choose and to understand the specificity of each. Since my package is not exclusively about debouncing but also throttling, I should rename it to give it a better fit identity.

The new name candidate is elm-control-msg. It fits well with the modules names also.

Transform update instead of view?

In an attempt at minimizing modifications, I have end up with a new message update (instead of modifying existing one) and a small modification of the view event.

I wonder if there is not a better way to do so, by just modifying update, and not touching the view?

How to debounce Cmds to outgoing ports?

From the examples it's not clear to me whether I can reduce the number of Cmds I send out through my port.

My scenario is an onInput handler on a password field to update the model and call a port with the password value to derive some cryptographic keys. Now I don't need to go through the port on every key stroke. Delaying the update the model is weird, because in my view I render input field with the value in the model, i.e. input [value model.value] so if I don't update the model the view will lag behind to the point that it doesn't even work properly. Now I wish I could only go through the port if 250ms have passed after the last onInput event rather than calling the relatively expensive port function each and every time.

I'd appreciate either an example or a statement in the docs whether this is possible and if so, how.

It's clear to me that I can manually keep track of the time and do the accounting on my end. But I'm investigating the solution space now and the more code I can recycle, the happier I will be.

Installation breaks Debugger's history export

Hello!
Thanks for building this cool and useful thing! I've been very happy with it since installing, but encountered some trouble today while debugging. I built my app with the debug flag and clicked in the history pane, then tried to export it. I got the following message:

Cannot use Import or Export
The Msgs.Msg type of your program cannot be reliably serialized for history files.
Functions cannot be serialized, nor can values that contain functions. This is a problem in these places:
Control.Control can contain functions.
The good news is that having values like this in your message type is not
so great in the long run. You are better off using simpler data, like
union types, in your messages. From there, your update
function can pattern match on that data and call whatever functions, JSON
decoders, etc. you need. This makes the code much more explicit and easy to
follow for other readers (or you in a few months!)

So that's a bummer! Do you have any idea for workarounds?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.