@reforj/logic-engine
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-alpha2 • Public • Published

Reforj / Logic engine

The library provides base wysiwyg logic builder with ui and js runtime.

Instalation

yarn add @reforj/logic-engine

npm i --add @reforj/logic-engine

Requirements as peer dependencies

"react": "^16.14.0",
"react-redux": "^7.1.0",
"react-dnd": "^11.0.0",
"react-dnd-html5-backend": "^11.0.0",

By defaul LogicEngine creates DnDProvder, you can pass useDndProvider={false} to disabled it.

Documentation

The engine splited in two parts as logic builder ui and runtime.

Follow the wiki or the examples section to check how to use UI and Runtime.

Examples

Builder UI integration

import { createRoot } from 'react-dom/client';
import { LogicEngine, getState } from '@reforj/logic-engine'
import '@reforj/logic-engine/style.css'

const root = createRoot(document.getElementById('container'));
root.render(<div style={{width: '100%', height: '90vh'}}>
  <LogicEngine />
</div>);

Runtime running

import { Runtime } from '@reforj/logic-engine/runtime'
const runtime = new Runtime()

const fn = runtime.build(data) // data represents getState from @reforj/logic-engine
fn()

codesandbox Example

Contributing

Pull requests and suggestions are welcome.

License

MIT License

Copyright (c) Fedor Tarasov

Readme

Keywords

Package Sidebar

Install

npm i @reforj/logic-engine

Weekly Downloads

0

Version

0.1.0-alpha2

License

MIT

Unpacked Size

247 kB

Total Files

12

Last publish

Collaborators

  • tarassovf