-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CURVE and RUNE]: drawing should not depend on evaluation result #65
Comments
This issue is related to #56. Proposed SolutionOutcomeThe solution aims to achieve the following outcomes.
In the Source evaluation context export interface Context<T = any> {
// Here lies all information related to the importing of modules
modules: {
// Individually, each bundle and tab will have access to the corresponding state.
// Bundles and tabs will be able to directly read and mutate this shared state to
// interact with each other.
state: {
module_name: {
// counter: 0
}
}
tabs: any[]
}
} During the compilation process of the bundles, the bundle should be wrapped in a manner similar to NodeJS modules. 3 main things will be passed into the wrapped bundle function as arguments, function (exports, state, config) {
// Here lies the program written in the module bundles.
// To expose a counter to the module's tab
state.counter = config.counter.defaultValue
exports.increment = func () {
state.counter++
}
exports.decrement= func () {
state.counter--
}
} The module tab should be able to access this counter through the ExampleThe The function draw(curve: Curve) {
state.drawnCurves = state.drawnCurves.append(curve)
} The class Curves extends React.Component<...> {
render() {
return (
<div>
// ... use this.props.state.drawnCurves.map(...)
</div>
)
}
} |
Yes, this makes sense to me. |
Feature
should draw the circle. Currently the drawers only draw when the result of the evaluation is a drawing. With the separate curve window, we can eliminate this hack.
The text was updated successfully, but these errors were encountered: