Skip to content
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

v4.0.0 #9

Closed
4 tasks done
Ruben-Arushanyan opened this issue Sep 2, 2022 · 0 comments
Closed
4 tasks done

v4.0.0 #9

Ruben-Arushanyan opened this issue Sep 2, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request p1 Priority 1

Comments

@Ruben-Arushanyan
Copy link
Owner

Ruben-Arushanyan commented Sep 2, 2022

New Approach, new API

Checklist

  • Implementation
  • Demo test
  • README docs
  • Manual Test using README docs

example:

import {Shell, createShellProvider} from 'react-component-shell'

class Game extends Shell {
   state = { paused: true }
    
   run() {
      this.updateState(state => {
          return {...state, paused: false}
      })
   }
    
   stop() {
      this.updateState(state => {
          return {...state, paused: true}
      })
   }

}

const ProviderWrapper = (props) => {
   const {shell, children} = props
   
   return children
}

const [GameProvider, useGame, useGameState] = createShellProvider({
    shellClass: Game,
    customProviderWrapper: ProviderWrapper
})
@Ruben-Arushanyan Ruben-Arushanyan added the enhancement New feature or request label Sep 2, 2022
@Ruben-Arushanyan Ruben-Arushanyan self-assigned this Sep 2, 2022
@Ruben-Arushanyan Ruben-Arushanyan added the p2 Priority 2 label Sep 22, 2022
@Ruben-Arushanyan Ruben-Arushanyan added p1 Priority 1 and removed p2 Priority 2 labels Oct 4, 2022
@Ruben-Arushanyan Ruben-Arushanyan mentioned this issue Oct 11, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p1 Priority 1
Projects
None yet
Development

No branches or pull requests

1 participant