Example code not work
sphynx79 opened this issue · 5 comments
sphynx79 commented
Hi,
i try to use this simple code in derivable 2.0.0-beta.3, i take this code from documentation
import { derive, atom, setDebugMode } from "derivable"
setDebugMode(true)
const x = atom(4)
const times = (a, b) => a * b
const xTimesTwo = x.derive(times, 2)
console.log(xTimesTwo.get())but result is NaN
until version 2.0.0-beta.1 this code work fine
sphynx79 commented
const x = atom(4);
const times = (a, b) => a * b;
const xTimesTwo = x.derive((x)=> times(x,2));in this way
TrySound commented
Yep, this way.
sphynx79 commented
also if i preferer old way!!
Thanks.
TrySound commented
Docs is a bad side of this project. If you would like to help with it I'm open for questions.