:soft_ice_cream: 联合会
Vanilla JS中的Composition-api
它是什么?
引入了一种令人惊叹的模式,称为 ,该模式可以通过将复杂的逻辑拆分为可重用的功能并按逻辑顺序进行分组来组织逻辑。 unctx允许您轻松地在JavaScript库中实现composition api模式。
一体化
在您的超赞库中:
yarn add unctx
# or
npm install unctx
import { createContext } from 'unctx'
const ctx = createContext ( )
export const useAwesome = ctx . use
// ...
ctx . call ( { test : 1 } , ( ) => {
// This is similar to vue setup function
// Any funct
评论0
最新资源