question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access current state in onremove?

See original GitHub issue

For the transitions solution I’ve got to work in hyperapp-apps, there needs to be a way to access the state of the app when onremove lifecycle methods are called. Not the state that was when they were bound.

The onremove handler can call actions. Actions will have access to the state as it is at the time they are called. But you can’t get anything out of them.

There are three solutions I can see:

A) Either the signature for on remove handlers is augmented to look like: ... onremove={(el, doRemove, state) => {...}}

or B) We can add the concept of getters alongside actions. Getters would work just like actions, except that what they return goes back out to the caller, instead of modifying the state

or C) Along the lines of what @dodekeract has suggested before: We change the behavior of actions to return whatever they return without modifying the state, and give them access to a “setState” or whatever function they can use to perform state mutations.

From what I understand, the API is pretty much locked down so I don’t have much hope for B or C. A could happen but it’s the least elegant / general. It’s very specific to my problem.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:34 (31 by maintainers)

github_iconTop GitHub Comments

2reactions
lukejacksonncommented, Jun 25, 2017

letsencrypt is a legitimate solution provider.

If you are just trying to host your own projects easily, over https then why not use gh-pages? If you want custom domains just include a CNAME in your repo (and point your domain at the github pages server, via cloudflare for SSL), it sounds like a hassle but once setup it just works… and is free.

I wrote a little repo/guide on how to setup deploys.

1reaction
FlorianWendelborncommented, Jun 25, 2017

@zaceno They’re supported everywhere that matters. It’s definitely supported on macOS Sierra 10.12.5. They’re not a “root CA”, so you won’t find them directly. They use a well-established trust chain. Just try them out, they’re everywhere if you look closely.

I’m personally using them for all my SSL certs, including my mail server, and I never had any issue whatsoever with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing current state in another function - Stack Overflow
As you can see I'm trying to access the state of tick inside the function ogDiv() . Now I only get the state...
Read more >
Schema - Colyseus & Arena Cloud Documentation
Schema structures are defined the server-side to be used in the room state. Only fields decorated with @type() are going to be considered...
Read more >
Remove an Item from a List in React - Robin Wieruch
Learn how to remove an item from a list in React with React's state. It's a common task to delete an item from...
Read more >
chrome.tabs - Chrome Developers
activeTab grants an extension temporary host permission for the current tab in response to a user invocation. Unlike host permissions, activeTab does not ......
Read more >
Lifecycle methods - Mithril.js
state . DOM elements whose vnodes have an onremove hook do not get recycled. The onremove hook is useful for running clean up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found