gordonbrander / spellcaster

Reactive signals UI library
MIT License
58 stars 2 forks source link

Options to integrate with Lit #63

Open woodcox opened 1 month ago

woodcox commented 1 month ago

Hi @gordonbrander, I really like spellcaster’s api design 👌. I wondered if you wanted to include options/examples for Lit integration if like me you don’t want to use your custom hyperscript. I’ve converted how withWatch, watch() directive and signal watcher works for preact-signals Lit integration to make it work with Spellcaster. Here is the codepen. What do you think?

gordonbrander commented 1 month ago

@woodcox can you say more about what you're looking to accomplish?

Lit is in the process of integrating native signals. Since Spellcaster's APIs also use native signals/the same polyfill, it should work with Lit's signals integration.

woodcox commented 1 month ago

@gordonbrander as I said I really like the api design and I was looking at straight forward/standards aligned options for sharing state in a small web based game. I was looking at lit or uhtml/reactive along with Spellcaster. The TC39 proposal for signals seems to be really well thought out and I wanted to use a signals library that was built on top of it.

Thanks for sharing the news that Lit is shipping the watch directive for TC39 signals. I had not realised lit was in the process of supporting signals. I’ll give that a go with Spellcaster and make sure it works as expected and will fit my use case.