Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

withCache causing Lint Type error #946

Open
ziongh opened this issue Oct 24, 2024 · 0 comments
Open

withCache causing Lint Type error #946

ziongh opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ziongh
Copy link

ziongh commented Oct 24, 2024

What happened?

withCache is causing Lint Type error when used.

Lint Error:

The inferred type of 'sampleReatomResource' cannot be named without a reference to '.pnpm/@reatom+async@3.16.2/node_modules/@reatom/async/build/withCache'. This is likely not portable. A type annotation is necessary.ts(2742)

code:

export const sampleReatomResource = reatomResource(async (ctx) => {
	return await ctx.schedule(() => {
		const number = 10;
		return Promise.resolve(number);
	});
}, 'sampleReatomResource ').pipe(
	withDataAtom(null),
	withErrorAtom(),
	withCache({ withPersist: withLocalStorage }), // <========== If we comment this line the error goes away
	withConcurrency('first-in-win'),
	withStatusesAtom(),
);

Part

Package @reatom/framework

Version

3.4.52

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

@ziongh ziongh added the bug Something isn't working label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant