Comments (5)
Hi @lxsmnsyc I see this already implemented in code but is that not flagged ready to use?
Try to use it with solid start but seem like doesn't work
export const logHello = async function (message: string) {
'use server'
console.log(message)
return {
title: 'Hello World',
async* [Symbol.asyncIterator](): AsyncIterator<number> {
await Promise.resolve()
yield 1
await new Promise((resolve) => setTimeout(resolve, 1000))
yield 2
await new Promise((resolve) => setTimeout(resolve, 5000))
yield 3
},
}
}
export const logHello = async function * (message: string) {
"use server";
console.log(message);
yield { a: true }
await new Promise((resolve) => setTimeout(resolve, 5000))
yield { b: true }
};
from seroval.
@ducan-ne Last time I've tested this this should work. Please provide more info.
from seroval.
@lxsmnsyc
The lastest version should show catch the error
https://github.com/ducan-ne/solid-async-generator-reproduction/blob/main/src/actions.tsx
https://github.com/ducan-ne/solid-async-generator-reproduction/blob/main/src/components/Counter.tsx
for await (const value of logHello('Hello')) {
not work either
Error
Uncaught (in promise) TypeError: logHello(...) is not a function or its return value is not async iterable
Or
Counter.tsx:20 Uncaught (in promise) {a: true}
This is my first time tried solid start so I'm not sure it's right way to use generator, but that's how we use it js
from seroval.
Okay I've tested this one, this isn't a Seroval problem. Please create an issue in SolidStart.
I intend to clean up this thread since it merits its own issue thread.
from seroval.
Okay, thank for your infromation
from seroval.
Related Issues (18)
- Feature: well-known symbols
- Feature: Streaming
- Feature: AsyncIterable
- Feature: Global identities HOT 1
- Feature: JSON string serializer HOT 1
- Feature: Structured Clone Algorithm HOT 1
- Support for Class HOT 1
- Better serialization for `Blob` and `File` HOT 1
- Combined types
- Custom serialization API
- serialise date to number instead of string HOT 7
- Edge Case: Mistake on isolating Map entries
- Inside of getCrossReferenceHeader script, getting error Uncaught SyntaxError: Unexpected identifier '_$HY'
- An unhandled error occured: Error: Cannot serialize function without reference ID HOT 2
- More support
- serialize 0x prefix string object key as number HOT 2
- Allow opting out of serialization HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seroval.