You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a class that accepts (or tries to, at least) 3 types of content in its content property:
A component
A snippet
A single-spa parcel
The class used to work fine with custom isSnippet and isParcel functions. The former one was working by checking the content was an object that had a render function. This seems to have changed now. It seems that snippets are now (also?) functions.
Describe the proposed solution
Instead of us, mere mortals, having to guess what constitutes a snippet, it would be nice if Svelte provided us with an isSnippet() function that would always be accurate. Taking out the guesswork is the main concern here.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered:
That would be an interesting approach, but unsure how it would play in the TypeScript world. The idea of this function is probably simpler to achieve. I just need the following from Svelte:
exportfunctionisSnippet(obj: unknown): obj is Snippet{ ... }
A simple Boolean function that narrows types in TS. The idea of a single syntax for components and snippets is cool, though. I suppose it is also harder to achieve, TS-wise.
Describe the problem
We use a class that accepts (or tries to, at least) 3 types of content in its
content
property:single-spa
parcelThe class used to work fine with custom
isSnippet
andisParcel
functions. The former one was working by checking the content was an object that had arender
function. This seems to have changed now. It seems that snippets are now (also?) functions.Describe the proposed solution
Instead of us, mere mortals, having to guess what constitutes a snippet, it would be nice if Svelte provided us with an
isSnippet()
function that would always be accurate. Taking out the guesswork is the main concern here.Importance
would make my life easier
The text was updated successfully, but these errors were encountered: