feat: Complete fleet — 94 skills across 10+ domains
Pulled ALL skills from 15 source repositories: - anthropics/skills: 16 (docs, design, MCP, testing) - obra/superpowers: 14 (TDD, debugging, agents, planning) - coreyhaines31/marketingskills: 25 (marketing, CRO, SEO, growth) - better-auth/skills: 5 (auth patterns) - vercel-labs/agent-skills: 5 (React, design, Vercel) - antfu/skills: 16 (Vue, Vite, Vitest, pnpm, Turborepo) - Plus 13 individual skills from various repos Mosaic Stack is not limited to coding — the Orchestrator and subagents serve coding, business, design, marketing, writing, logistics, analysis, and more. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
51
skills/vueuse-functions/references/createUnrefFn.md
Normal file
51
skills/vueuse-functions/references/createUnrefFn.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
category: Utilities
|
||||
related: reactify
|
||||
---
|
||||
|
||||
# createUnrefFn
|
||||
|
||||
Make a plain function accepting ref and raw values as arguments.
|
||||
Returns the same value the unconverted function returns, with proper typing.
|
||||
|
||||
::: tip
|
||||
Make sure you're using the right tool for the job. Using `reactify`
|
||||
might be more pertinent in some cases where you want to evaluate the function on each changes of it's arguments.
|
||||
:::
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { createUnrefFn } from '@vueuse/core'
|
||||
import { shallowRef } from 'vue'
|
||||
|
||||
const url = shallowRef('https://httpbin.org/post')
|
||||
const data = shallowRef({ foo: 'bar' })
|
||||
|
||||
function post(url, data) {
|
||||
return fetch(url, { data })
|
||||
}
|
||||
const unrefPost = createUnrefFn(post)
|
||||
|
||||
post(url, data) /* ❌ Will throw an error because the arguments are refs */
|
||||
unrefPost(url, data) /* ✔️ Will Work because the arguments will be auto unref */
|
||||
```
|
||||
|
||||
## Type Declarations
|
||||
|
||||
```ts
|
||||
export type UnrefFn<T> = T extends (...args: infer A) => infer R
|
||||
? (
|
||||
...args: {
|
||||
[K in keyof A]: MaybeRef<A[K]>
|
||||
}
|
||||
) => R
|
||||
: never
|
||||
/**
|
||||
* Make a plain function accepting ref and raw values as arguments.
|
||||
* Returns the same value the unconverted function returns, with proper typing.
|
||||
*
|
||||
* @__NO_SIDE_EFFECTS__
|
||||
*/
|
||||
export declare function createUnrefFn<T extends Function>(fn: T): UnrefFn<T>
|
||||
```
|
||||
Reference in New Issue
Block a user