Coder Social home page Coder Social logo

overmind-website's Issues

Typo in TypeScript for getter. Missing colon `:`

I found some typos on https://overmindjs.org/core/typescript

For exammple, the following code:

import { derived } from 'overmind'

type State = {
  foo: string
  shoutedFoo string
}

export const state: State = {
  foo: 'bar',
  shoutedFoo: derived<State, string>(state => state.foo + '!!!')
}

I think shoutedFoo string should be shoutedFoo: string. There is a missing colon. There are bunch of other code blocks where there is a missing colon :)

Question

hello, everyone, I have a problem, I have used overmind js lately and I have a problem, if I have an overmind js effect that fetches API data and stores it in the overmind state, how can i access this data and put some of this data in react state hook inside the component

Questions about TypeScript page

Personally, I think the configuration section on the TypeScript page, is a little confusing and assumes knowledge of a TypeScript feature that is not widely understood. (By me, up to now, anyway!)

  1. Under Explicit Typing section the note says the 'The Overmind documentation is written for implicit typing'.
    Is implicit typing the Declare module approach?

  2. At first, I did not understand what typeof was doing here:

// Due to circular typing we have to define an
// explicit typing of state, actions and effects since
// TS 3.9
export interface Config extends IConfig<{
  state: typeof config.state,
  actions: typeof config.actions,
  effects: typeof config.effects
}> {}

I only understood the code (I hope!) after reading this article.

I think the documentation may benefit from the following blurb, or similar.

// Note: The typeof keyword is being used here by TypeScript to type query
// the configuration.
// (It is NOT being used by JavaScript to return the type of the operand 
// as a string.)
// See https://mariusschulz.com/blog/type-queries-and-typeof-in-typescript for
// an explanation of the differences between typeof in TypeScript and JavaScript.

I am happy to submit a pull request for the above, but I thought I would get some feedback first, and ascertain whether I have properly understood the concepts.

www.overmindjs.org is broken

Whatever www.overmindjs.org is pointing to is broken. overmindjs.org without the www works fine.

$ nslookup www.overmindjs.org
Server:		2601:646:c400:a810:22c9:d0ff:fe99:5cc4
Address:	2601:646:c400:a810:22c9:d0ff:fe99:5cc4#53

Non-authoritative answer:
www.overmindjs.org	canonical name = 0rjvu8x6.easyredirengine.com.
Name:	0rjvu8x6.easyredirengine.com
Address: 34.213.106.51
Name:	0rjvu8x6.easyredirengine.com
Address: 54.68.182.72

vs.

$ nslookup overmindjs.org
Server:		2601:646:c400:a810:22c9:d0ff:fe99:5cc4
Address:	2601:646:c400:a810:22c9:d0ff:fe99:5cc4#53

Non-authoritative answer:
overmindjs.org	canonical name = hosting.gitbook.com.
hosting.gitbook.com	canonical name = fasthosting.gitbook.com.
Name:	fasthosting.gitbook.com
Address: 104.236.176.100

Svelte Reactions example doubt

In Svelte Reactions example here: https://overmindjs.org/views/svelte#reactions, where the store comes from?

<script>
  import { state, actions, reactions } from './overmind.js'

  $: count = $state.count
  let doubled = undefined
  store.reaction(
    (state) => state.count,
    (value) => {
        doubled = value * 2
    },
    {
        immediate: true
    }
  )
</script>

<p>Count: {count}</p>
<p>Doubled: {doubled}</p>
<button id="increase" on:click={() => store.actions.increase()}>Increase</button>
<button id="decrease" on:click={() => store.actions.decrease()}>Increase</button>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.