GithubHelp home page GithubHelp logo

ticket-bridge / hyper-durable Goto Github PK

View Code? Open in Web Editor NEW
63.0 0.0 3.0 44.83 MB

Simple and useful Durable Object abstraction

License: MIT License

TypeScript 97.33% JavaScript 2.67%
cloudflare durable durable-objects objects

hyper-durable's People

Stargazers

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

hyper-durable's Issues

Map, Set

if I can use Map or Set. Will there be any problems?

#<Object> could not be cloned.

Trying to get a service setup using this lib however im running into some strange issues with persistance.

For some reason, when doing a filter over an array, it breaks with the error "# could not be cloned.". While debugging, it appears that forcing JS to create a new Array using JSON.parse/stringify, it successfully saves. Although i'm not convinced this hotfix will work 100% of the time.

console.log(
  this.repeat_queue, // [   { event: 'testEvent.created', object: {  }, repeat_count: 0 } ]
  this.repeat_queue.isProxy // true
)

this.repeat_queue = this.repeat_queue.filter(e => e.id != event.id)

console.log(
  this.repeat_queue, // [   { event: 'testEvent.created', object: {  }, repeat_count: 0 } ] - Yes, the array is the same. However its considered dirty due to the Filter (??)
  this.repeat_queue.isProxy // true
)

If you wanted to see the code for yourself:
https://github.com/drivly/webhooks.do/blob/main/src/webhook.durable.js#L119

Issue with nested objects

Love the library! Thanks for releasing it :)

I keep getting a type error when I use nested objects:

TypeError: this is not a Date object.
        at Proxy.valueOf (<anonymous>)

This occurs when you have a DOI with a nested object:

class MyDo {
  my_dates: {
    created_at: Date
  }
  
  ...
}

I've modified the Counter DO and tests to include a property like the above and the tests do cause an exception. Here's my fork and branch where I'm trying to fix this: https://github.com/fisherdarling/hyper-durable/tree/feat/fix-proxy-getters

Any thoughts would be much appreciated! And again, thanks for making such an awesome library :D

Typed HyperDurable class methods?

Hello, I've been playing around with the library and really enjoying it, but can't figure out how to make HyperDurable class methods type safe. Is there a way to get a strongly typed stub?

Screen Shot 2023-06-11 at 9 47 42 AM

websocket

please make an example with websockets

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.