Giter Club home page Giter Club logo

Comments (12)

danreeves avatar danreeves commented on September 27, 2024

Hi πŸ‘‹

I'm gunna try to make a PR for this tonight. Sound good?

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

Sounds amazing :) All yours

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

Hey @danreeves what’s status?

from hoodie-client.

danreeves avatar danreeves commented on September 27, 2024

Hi @gr2m, finally had some time to look at this tonight. I've had some issues getting hoodie@next and hoodie-client working together but that's maybe another issue. I've made a WIP PR here: #32

Looking like the right direction?

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

Awesome I'll check it out tomorrow, thanks a ton!

from hoodie-client.

Guria avatar Guria commented on September 27, 2024

@gr2m I am not guru in api design, but options.promise = options.promise.then looks ugly for me. can't we just return promise and manage it from callback caller instead?

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

Yeah I’m wondering if there is a nicer API :) But the one with options.promise is the best shot right now, as we can’t get the value that is returned by event handlers

hoodie.on('reset', function () {
  return new Promise(...) // this goes nowhere
})

hoodie.trigger('reset')

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

@Guria here’s an alternative API suggestion to intercept things like reset events: #42

from hoodie-client.

danreeves avatar danreeves commented on September 27, 2024

@gr2m looks similar to something I was working on to get the .reset() call to be thenable without racing the event listeners: danreeves@9ded20e

edit: because options.promise = options.promise.then didn't appear to be working as expected

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

@danreeves clever!!

from hoodie-client.

gr2m avatar gr2m commented on September 27, 2024

@danreeves let’s put hoodie.reset on hold for now. We have to think about the hooks as we need it for the glue code between hoodie.store and hoodie.account, but hoodie.reset only becomes relevant with plugins which we put out of scope for the first release. I like your options.hooks idea, maybe we can use that implementation for the hooks in sign in / sign out

from hoodie-client.

danreeves avatar danreeves commented on September 27, 2024

Yeah, that makes sense

from hoodie-client.

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.