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 need a demo adapter to better demonstrate the functionality of Tux Admin in tux-example-site.
The adapter should have a simple way to initialise data. Something like this:
import { define } from 'tux-adapter-localstorage'
import { registerEditable, MarkdownField, Input } from 'tux'
// interface Instance {
// id: string
// }
// function define<T extends Instance>(model: string, instance: T): void
registerEditable('Quote', [
{
field: 'quote',
label: 'Quote',
component: MarkdownField,
}
{
field: 'author',
label: 'Author',
component: Input,
}
])
define('Quote', {
id: 'foo',
quote: '50% of the time, it works 100%',
author: 'Eirikur',
})
// [snip]
import { Adapter } from 'tux-adapter-localstorage'
import { tuxMiddleware } from 'tux'
createChain()
.chain(tuxMiddleware({
adapter: new Adapter()
}))
The define method should only save the instance if one doesn't already exist with the same id. It should only perform soft-deletes (so instances aren't recreated when you refresh).
The adapter's query api should be able to query in instance by id and type.
The text was updated successfully, but these errors were encountered:
We need a demo adapter to better demonstrate the functionality of Tux Admin in
tux-example-site
.The adapter should have a simple way to initialise data. Something like this:
The define method should only save the instance if one doesn't already exist with the same id. It should only perform soft-deletes (so instances aren't recreated when you refresh).
The adapter's query api should be able to query in instance by id and type.
The text was updated successfully, but these errors were encountered: