1.0.10 • Published 2 years ago

layrd v1.0.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Layrd is a tiny framework for composing vue3 "composables", but it has no dependencies on vue. Use Layrd when you want to compose a larger composable from many smaller ones.

// ./composables
const foo = (fooConfig, previousLayer, globalConfig) => {
  return { foo: 'foo' }
}

const bar = (barConfig, previousLayer, globalConfig) => {
  return {
    bar: 'bar',
    onInit: () => {
      /* If provided, this callback runs after the layrd object has been initialized. If an early layer need to sync state with later layers, initialize a watcher here. */
    }
  }
}

// ./inSomeOtherFile
const globalConfig = { name: 'myLayrdComposable' }

const fooConfig = {/* config object passed only to foo */}

const barConfig = {/* config object passed only to bar */}

const { foo, bar } = layrd(globalConfig)
  .layer(fooConfig)
  .layer(barConfig)
  .init(() => {
    /* This callback is run right before returning the entire layrd-object.
    May be used to set a semaphore "initialized" */
  })
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.10

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago