thefrontside / microstates

Composable state primitives for JavaScript
1.31k stars 53 forks source link

✍🏼Document the `from()` function to account for collection laziness #386

Closed cowboyd closed 4 years ago

cowboyd commented 4 years ago

A while back, the change was made to not allow direct keyed access to Object and Array. While we updated most of the documentation to include those changes, the documentation of the from() method was not. As a result, this was misleading.

This change refactors the examples to use either the entries map on object or the destructuring which uses the iterability of both Array and Object.

resolves #385

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 98.74% when pulling 927fde6c845471977c1acb7f8708362000071156 on update-from-fn-docs into 3218cfb385b3f0cccd8f0a2cb645a93d504cfd36 on master.

frontsidejack commented 4 years ago

A preview package of this pull request has been released to NPM with the tag update-from-fn-docs. You can try it out by running the following command:

$ npm install microstates@update-from-fn-docs

or by updating your package.json to:

{
  "microstates": "update-from-fn-docs"
}

Once the branch associated with this tag is deleted (usually once the PR is merged or closed), it will no longer be available. However, it currently references microstates@0.15.1-6f67343 which will be available to install forever.

Generated by :no_entry_sign: dangerJS against 507d7d34b9381a937ba24f270155e222df1a9e64

frontsidejack commented 4 years ago

A preview package of this pull request has been released to NPM with the tag update-from-fn-docs. You can try it out by running the following command:

$ npm install microstates@update-from-fn-docs

or by updating your package.json to:

{
  "microstates": "update-from-fn-docs"
}

Once the branch associated with this tag is deleted (usually once the PR is merged or closed), it will no longer be available. However, it currently references microstates@0.15.1-c90848a which will be available to install forever.

Generated by :no_entry_sign: dangerJS against 927fde6c845471977c1acb7f8708362000071156