Skip to content

hello I am trying to apply the example "Custom relational functions" in the browser #2675

Answered by josdejong
archimagogabo asked this question in Q&A
Discussion options

You must be logged in to vote

This customization is unfortunately not possible to do from a given mathjs instance. The create function on a math instance differs from the static one available in the ES library:

const { create, all, factory } = require('mathjs')
// the static function has syntax: create(factories, config)

const math = create(all)
// the instance method has syntax: math.create(config)

This is confusing, and a limitation in the browser bundle. It may be possible to expose the static function too, so you can do that too from the browser bundle.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by josdejong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2287 on August 17, 2022 12:47.