Coder Social home page Coder Social logo

Comments (7)

cmsj avatar cmsj commented on May 18, 2024

Hi

This needs careful thought - if the new confit after the reload no longer wants the stuff being preserved, we'll need to gc it somehow.

Cheers,

Chris Jones

On 10 Oct 2014, at 14:02, Peter van Dijk [email protected] wrote:

caffeinate would like this, also probably some other modules.


Reply to this email directly or view it on GitHub.

from hammerspoon.

Habbie avatar Habbie commented on May 18, 2024

Good point. Easy if we just allow strings and ints to persist, hard (impossible?) if we allow modules to persist any kind of object.

from hammerspoon.

Habbie avatar Habbie commented on May 18, 2024

Based on IRC discussion: how about one table that persists over reloads (but not restarts?), plus a flag to setup.lua (visible from init.lua) that tells the user whether this is a fresh start or not? Users/extensions would just save state to this table on any change (thus avoiding an 'on reload' hook).

from hammerspoon.

cmsj avatar cmsj commented on May 18, 2024

+1. I'd go for a table that persists over reloads, but not restarts. We have hs.settings for that, if people want to do that sort of thing.
I think ideally the flag would indicate "reload", "restart", "first" (the latter meaning that this is the first time HS has been launched since the computer was booted)

from hammerspoon.

cmsj avatar cmsj commented on May 18, 2024

Do we have any idea how we would persist a Lua table across a reload? Given that the table could contain almost anything!

from hammerspoon.

Habbie avatar Habbie commented on May 18, 2024

What's the problem with limiting it to basic types (float, string)?

from hammerspoon.

cmsj avatar cmsj commented on May 18, 2024

I don't think anyone is going to work on this issue - it can be worked around trivially by using hs.settings to store some ephemeral data and then clearing it as soon as it's been used.

from hammerspoon.

Related Issues (20)

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.